LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default VLookup error - Sub or function not defined

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Defined Function and VLookUP Kevin Excel Worksheet Functions 11 October 26th 09 02:10 AM
Export a chart in a GIF file. Run-time error '1004': Application-defined or object-defined error; [email protected] Excel Programming 4 September 16th 07 11:09 PM
Excel - User Defined Function Error: This function takes no argume BruceInCalgary Excel Programming 3 August 23rd 06 08:53 PM
vlookup, add parameter, on error return user defined value jims2994 Excel Worksheet Functions 0 July 7th 06 02:56 PM
Vlookup in user defined function Tim Svensson Excel Programming 1 January 13th 04 10:19 AM


All times are GMT +1. The time now is 10:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"