O
obc1126
I have a VLookup formula which works fine. I want to convert the formula into
macros so that i don't have to copy and paste the formula each time i have a
new data.
I get an compile error says Sub or function not defined when i run the code.
What does this mean?
The formula : -
IF($B2=9000000,(VLOOKUP($C2,Info!$G$2:$H$60,2,FALSE)),(VLOOKUP($B2,Info!$J$2:$K$60,2,FALSE)))
The macro : -
Sub AssignJobDescription()
For i = 2 To FinalRow
If Cells(i, 2).Value = "9000000" Then
Cells(i, 8).Value = (IsNA(VLookup(Cells(i, 3).Value, "Info!G2:H60", "2",
False)))
Else
Cells(i, 8).Value = (IsNA(VLookup(Cells(i, 2).Value, "Info!J2:K48", "2",
False)))
Next i
End If
End Sub
macros so that i don't have to copy and paste the formula each time i have a
new data.
I get an compile error says Sub or function not defined when i run the code.
What does this mean?
The formula : -
IF($B2=9000000,(VLOOKUP($C2,Info!$G$2:$H$60,2,FALSE)),(VLOOKUP($B2,Info!$J$2:$K$60,2,FALSE)))
The macro : -
Sub AssignJobDescription()
For i = 2 To FinalRow
If Cells(i, 2).Value = "9000000" Then
Cells(i, 8).Value = (IsNA(VLookup(Cells(i, 3).Value, "Info!G2:H60", "2",
False)))
Else
Cells(i, 8).Value = (IsNA(VLookup(Cells(i, 2).Value, "Info!J2:K48", "2",
False)))
Next i
End If
End Sub