VBA macro Cell argument
HELP PLEASE: trying to compare the result of a cell formula in Cells(A, "C") its contains the result of a Vlookup, I am trying to look for < with another cell Cells(A, "E") the macro runs once then locks up error code 2042. Anyone any ideas please? Or better code !!!
Sub CellCompare()
Dim A As Integer
A = 1
Sheets("NIMROD001").Select
Do Until IsEmpty(Cells(A, "B"))
If Cells(A, "C") < Cells(A, "E") Then ' Doesnt like formulae
Rows(A).Copy
Sheets("Sheet1").Select
Cells(ActiveCell.Row + 1, 1).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Sheets("NIMROD001").Select
End If
A = A + 1
Loop
End Sub
|