does the first criteria for the VLookup function have to be a cell or can it be a string of text?
Thanks
![]()
Please Login or Register to view this content.
does the first criteria for the VLookup function have to be a cell or can it be a string of text?
Thanks
![]()
Please Login or Register to view this content.
Hi edoptx,
First criteria in vlookup function is "lookup_value" as explained below:-
lookup_value Required. The value to search in the first column of the table or range. The lookup_value argument can be a value or a reference. If the value you supply for the lookup_value argument is smaller than the smallest value in the first column of the table_array argument, VLOOKUP returns the #N/A error value.
It is a cell and not the collection of texts (i.e., String)
Whatever you have in lookup_value will have to be there in your data table as well.
In your case QuestNum is appears to be one question number and it can't be more than one question papers... unless your data is arranged in that way
e.g., A1 is 1 and your datatable has 1 in first column -> it will work
e.g., A2 is 1,2,3 and your datatable has 1,2,3 in first column BUT in differenct cells -> it wont work..
I hope this is clear now..
Thanks.
Regards,
DILIPandey
<click on below 'star' if this helps>
DILIPandey, Excel rMVP
+919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com
thanks for the reply.
so if Questnum= com2 for example
the Vlookup will find where com2 exists and store it as Qest
does this work well with info on different sheets or is there a better way to write it?
thank you.
thanks for the reply.
so if Questnum= com2 for example
the Vlookup will find where com2 exists and store it as Qest
does this work well with info on different sheets or is there a better way to write it?
thank you.
thanks for the reply.
so if Questnum= com2 for example
the Vlookup will find where com2 exists and store it as Qest
does this work well with info on different sheets or is there a better way to write it?
thank you.
Last edited by edoptx; 08-13-2012 at 12:30 PM. Reason: delete
Hi edoptx,
As per your code:- "Qest = Application.WorksheetFunction.VLookup(Questnum, mylookup, 3, False)", it will check questnum in range mylookup and will return result from column 3 and yes that will get stored in Qest
Regards,
DILIPandey
<click on below 'star' if this helps>
thank you
Edoptx
You are welcome Edoptx..
Cheers
Regards,
DILIPandey
<click on below 'star' if this helps>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks