VB Formula / Vlookup

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

Hi

I'm trying to create a macro that populates a cell in a
worksheet with a vlookup formula, however, the table array
is another workbook and is variable.

here is my code so far...

Let X = Range("factsaccount") & "." & Range("workstation")
Range("NAV") = "=VLOOKUP(""Net Assets"",X$C:$D,2,FALSE)"


Thanks

-Dennis
 
Maybe this technique will help:

dim myRng as range

set myrng _
= workbooks("otherworkbook").worksheets("otherworksheet").range("c:d")

range("nav").formula = "=vlookup(""net assets""," & _
myrng.address(external:=true) & ",2,false)"

===
But I'm not sure how X fit in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Vlookup Help 0
Using vlookup in VB 2
Need Help with VLOOKUP 4
VLOOKUP returning #N/A result 2
vlookup range 4
vlookup table_array 4
vlookup copy down 1
Dynamic named range reference from external workbook 2

Back
Top