Sub NewRefesh()
If Not Range("X2") = "COMPLETE" Or Range("X2") = "CANCELLED" Then
Range("X2").Select
ActiveCell.FormulaR1C1 = "=GetOrderStatus(RC[1])"
End If
End Sub
The above code does for only X2 but i want do it till X52.
(Ex: Next check in X3 = COMPLETE" Or Range("X3") = "CANCELLED" Then Range("X3").Select ActiveCell.FormulaR1C1 = "=GetOrderStatus(RC[1])"and do the action, next X4 and so on
I think in your post you meant your criteria to be :
Note: it's better to stay away from
Select
andActiveCell
, instead use referencedRange
s. In your code you code directly useRange("X" & i).FormulaR1C1
Code
use row/col numbering
x is Column number 24