$$Excel-Macros$$ Re: Variable Workbook name used in range formula

2009-09-08 Thread Dave Bonallack
Hi, I haven't tested this, but I think you need: Range("data") = "=vlookup(R[-1]C,[" & CarrierGrid & "]OAK!L:R,7,False)" ie, use square brackets instead of ' Regards - Dave > Date: Tue, 8 Sep 2009 07:26:00 -0700 > Subject: $$Excel-Macros$$ Variable Workbook name used in range formula >

$$Excel-Macros$$ Re: Variable Workbook name used in range formula

2009-09-08 Thread Paul Schreiner
 I think you're missing the square brackets "[]". I used:     Range("data") = _     "=VLOOKUP(RC[-1],'[" & CarrierGrid & "]OAK'!C1:C5,5,FALSE)" and it worked great. (try recording a macro where you insert the formula, then replace the file name with the "& variable &" syntax. Just leave the