Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Geeske Bakker   on Feb 01 In MS Office Category.

  
Question Answered By: Lenora Green   on Feb 01

KeyStartRow and TitleCol are local variables in your program, but you are
putting them in the formula as part of the quoted static part of the
formula. I.e. the formula becomes

=VLOOKUP(Cells(KeyStartRow, TitleCol),Ref.Tables!K:L,2,FALSE)

In fact the whole "Cells(KeyStartRow, TitleCol)" is wrong. You need a cell
address. E.g.

Selection.FormulaR1C1 = "=VLOOKUP(R" & KeyStartRow & "C" & TitleCol &
",'Ref.Tables'!C[4]:C[5],2,FALSE)"

I'm not sure what you mean by 'Ref.Tables'!C[4]:C[5] either. That's a
relative reference 4 and 5 columns to the right of some unspecified position
in the Ref.Tables sheet. Do you want absolute references?

Share: