• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to create the VBA in order to vlookup for two different excel files

umeed

New Member
Hi ,
I am new in VBA and need assistance.
Is it possible to create a VBA code in order to Vlooklup two different excel files.
and then i want that result to be copied to third excel file.

i use below vlookup method
=VLOOKUP(A2,[SecondFile.xlsx]Sheet1!$A$1:$D$9,4,FALSE)

and i want same to be done via VBA and then it should give results in all cells
 
Welcome to the board!

You might looking something like this.

Code:
Range("B2:B6") = "=VLOOKUP(A2,[SecondFile.xlsx]Sheet1!$A$1:$D$9,4,FALSE)"
 
One more query..is there a way to select the row and cloumns dynamically.
For example..if i am not sure how many rows and columns are non-empty and therefore if i want to select the range of non-empty cells,please advise how can this be achieved using VBA.
 
Back
Top