Hi Shilpa,
If you really want to do this with VBA, use the code below.

Sub VlookupVBA()
    A = 1   'Start Row
    Do Until Cells(A, 1) = ""
        With Sheets("Sheet2").Range("A1:A6")
            Set c = .Find(Cells(A, 1), LookIn:=xlFormulas, lookat:=xlWhole)
            If Not c Is Nothing Then Cells(A, 2) = 
Sheets("sheet2").Cells(c.Row, 2)
            A = A + 1
        End With
    Loop
End Sub

I have also attached a workbook with this code. Just click on the "Update" 
button.
The code assumes that the data on sheet1 has no gaps. A blank cell in Column A 
is the trigger for it to stop. This can be changed if necessary.
Remember to enable macros.
Regards - Dave.

Date: Sun, 24 Jan 2010 21:57:28 +0530
Subject: $$Excel-Macros$$ 
From: shilpa...@gmail.com
To: excel-macros@googlegroups.com

Hi Team,

Kindly help me in writing macro for a vlookup formula, since I have line item 
more thant 50k lines so I want get macro for this.
Regards,
Shilpa





-- 

----------------------------------------------------------------------------------

Some important links for excel users:

1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip

2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com

3. Excel tutorials at http://www.excel-macros.blogspot.com

4. Learn VBA Macros at http://www.quickvba.blogspot.com

5. Excel Tips and Tricks at http://exceldailytip.blogspot.com

 

 

To post to this group, send email to excel-macros@googlegroups.com

If you find any spam message in the group, please send an email to:

Ayush Jain  @ jainayus...@gmail.com

<><><><><><><><><><><><><><><><><><><><><><>

HELP US GROW !!

 

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe
                                          
_________________________________________________________________
Shopping Trolley Mechanic If It Exists, You'll Find it on SEEK
http://clk.atdmt.com/NMN/go/157639755/direct/01/

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,700 subscribers worldwide and receive many nice notes about the 
learning and support from the group.Let friends and co-workers know they can 
subscribe to group at http://groups.google.com/group/excel-macros/subscribe

Attachment: VlookupVBA.xlsm
Description: application/vnd.ms-excel.sheet.macroenabled.12

Reply via email to