using variable names in VLOOKUP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using a line of code that uses a variable to look at a set sheet and it
works great. The "TwoMonthsAgo" variable is what I am using to look at a
sheet named "Sep04"

Activecell.formulaR1C1 = "=VLOOKUP(RC1, ' " & TwoMonthsAgo & " ' !C1:C[82],
82, FALSE)"

Now I have another variable "TrendFile" that is the name of the workbook
that the "Sep04" sheet is in. The problem I am having in setting up the
VLOOKUP function from another workbook. I would like to be in workbook-A and
look at the "TrendFile" workbook on sheet "TwoMonthsAgo".

Thanks for any help you can give.
 
Hi Tony,

Activecell.formulaR1C1 = "=VLOOKUP(RC1, ' " & "['" & TrendFile & "]" &
TwoMonthsAgo & " ' !C1:C[82],
82, FALSE)"
 

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

Back
Top