Hello all,
I am relatively new to the VB code for Excel macro and wanted to get your advise on the following macro..
'=== CODE START ===
Sub c_SLCodeThisWk()
Dim t As Long
For t = 2 To 100
Range("AR" & t).Formula = "=LOOKUP(2^15,SEARCH({""Overdue"",""Red"",""PastY"",""Yellow"",""Green"",""Complete"",""No_BL""},RC44),{6,3,5,2,1,0,4})"
Next t
End Sub
'=== CODE COMPLETE ===
With this code, I am trying to populate a formula in the 2 nd row of Column AU, with the pseudo code logic:
Problem is, I am getting an #NA value in place of the correct number in the destination cell for all the rows.
I think, there is some small change needed in the formula. Any advise?
I am relatively new to the VB code for Excel macro and wanted to get your advise on the following macro..
'=== CODE START ===
Sub c_SLCodeThisWk()
Dim t As Long
For t = 2 To 100
Range("AR" & t).Formula = "=LOOKUP(2^15,SEARCH({""Overdue"",""Red"",""PastY"",""Yellow"",""Green"",""Complete"",""No_BL""},RC44),{6,3,5,2,1,0,4})"
Next t
End Sub
'=== CODE COMPLETE ===
With this code, I am trying to populate a formula in the 2 nd row of Column AU, with the pseudo code logic:
- Check the value in Column AR of the same row
- Populate a number (from 0 / 1 / 2 / 3 /4 /5 / 6), based on the string in Column AR of the same row.
- Move to the next row to refer the same logic till there is no more row left.
Problem is, I am getting an #NA value in place of the correct number in the destination cell for all the rows.
I think, there is some small change needed in the formula. Any advise?
Last edited: