B
BrianW
New to VBA. Excel 2003
I'm getting a compile error: Variable not defined, in the following Macro.
(General) = Open Explicit.
How do I set the variable for Counter
Sub ItemsToPrice()
For Counter = 1 To 300
Set curCell = Worksheets("Sheet4").Cells(Counter, 18)
If Abs(curCell.Value) = 2 Then curCell.Select
Range("C" & ActiveCell.Row & ":M" & ActiveCell.Row).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
Selection.Font.ColorIndex = 3
Selection.Font.Bold = True
Range("R" & ActiveCell.Row).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("H" & ActiveCell.Row).Select
Selection.ClearContents
Next Counter
End Sub
I'm getting a compile error: Variable not defined, in the following Macro.
(General) = Open Explicit.
How do I set the variable for Counter
Sub ItemsToPrice()
For Counter = 1 To 300
Set curCell = Worksheets("Sheet4").Cells(Counter, 18)
If Abs(curCell.Value) = 2 Then curCell.Select
Range("C" & ActiveCell.Row & ":M" & ActiveCell.Row).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
Selection.Font.ColorIndex = 3
Selection.Font.Bold = True
Range("R" & ActiveCell.Row).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Range("H" & ActiveCell.Row).Select
Selection.ClearContents
Next Counter
End Sub