Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Sunil
 
Posts: n/a
Default how to use a VLOOKUP function in a VBA code?

Hi
am a novice in excel...i have a excel sheet with 2 columns with around 10000
records.i have placed a button in the excel sheet and on clicking the button
it should find all the values in the first column which doesnt have a match
in the second column.for that i can use VLOOKUP function.but i dont know how
to use that one.
Can any one help me?

Thanks in advance....

With Regds

Sunil.T
  #2   Report Post  
mangesh_yadav
 
Posts: n/a
Default


WorksheetFunctions.Vlookup()

The arguments are similar

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378023

  #3   Report Post  
Sunil
 
Posts: n/a
Default

Hi,

i tried ..but am getting some errors...it will be very helpful for me if
u send me the syntax regarding my req.Thanks in advance

With regds
Sunil.T
"Sunil" wrote:

Hi
am a novice in excel...i have a excel sheet with 2 columns with around 10000
records.i have placed a button in the excel sheet and on clicking the button
it should find all the values in the first column which doesnt have a match
in the second column.for that i can use VLOOKUP function.but i dont know how
to use that one.
Can any one help me?

Thanks in advance....

With Regds

Sunil.T

  #4   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Hi Sunil,

Here's an example:

Private Sub CommandButton1_Click()

Set myRng = Worksheets("Sheet1").Range("A1:B10")
myLookup = 4

myValue = WorksheetFunction.VLookup(myLookup, myRng, 2)

End Sub


The table is A1:B10.
myLookup is the lookup_value which would be in column A. myValue is the
value corresponding to the myLookup as returned by the above formula.
2 is the column index number which tells the lookup to look for the
result in the second column of the table A1:B10 i.e. column B


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=378023

Reply
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
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
VLOOKUP Function Neoseraph Excel Worksheet Functions 12 April 4th 05 12:21 AM
How to use a cell value as Table Array in VLOOKUP worksheet function willydlish Excel Discussion (Misc queries) 2 February 16th 05 03:47 AM
VLOOKUP function Peters Excel Worksheet Functions 6 November 25th 04 08:07 PM
vlookup function in excel referencing an access table AJN Excel Worksheet Functions 1 November 7th 04 08:09 PM


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

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

About Us

"It's about Microsoft Excel"