Copy formulae using a macro - TechRepublic
Question
March 18, 2009 at 04:12 AM
davidcalver

Copy formulae using a macro

by davidcalver . Updated 17 years, 4 months ago

I want to creat a macro to copy a formula (in L2) into certain cells in col L based on what is in Col B, and have tried the following, but the Set curCell statement gives a run-time error 13. I have updated MS Office to the latest patches.
For Counter = 5 To 100
Set curCell = Worksheets(“Cases”).Cells(“B”, Counter)
If (curCell.Value) <> “Product” And (curCell.Value) <> “Description” And (curCell.Value) <> “” Then
Range(“L2”).Select
Selection.Copy
Set curCell = Worksheets(“Cases”).Cells(“L”, Counter)
ActiveSheet.Paste
End If
Next Counter

This discussion is locked

All Comments