Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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,FALS E)),(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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
User Defined Function and VLookUP | Excel Worksheet Functions | |||
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; | Excel Programming | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
vlookup, add parameter, on error return user defined value | Excel Worksheet Functions | |||
Vlookup in user defined function | Excel Programming |