Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile error

Status
Not open for further replies.

Groves22

Technical User
Jan 29, 2009
102
US
Hey all...
Why am I getting this error. I'm sure it has to do something with " and ', but I can't figure it out. Could someone look at this line and see if you can crack the code?! I get a Expected: end of statement error box
Code:
TempR.Sheets(1).Cells(q, 18).Formula = "=VLOOKUP($E5 & "-BI",'G:\ACIC Weekly Conversion Report\OH\1Data\[ACIC Weekly Conversion Report - Auto Attr (" rYear & rMonth & rDay ").xls]ACIC Weekly Conversion Report - Auto Attr (" rYear & rMonth & Rday ")'!$B$2:$K$65536,5,FALSE)&"/"&VLOOKUP($E5 & "-PD",'G:\ACIC Weekly Conversion Report\OH\1Data\[ACIC Weekly Conversion Report - Auto Attr (" rYear & rMonth & rDay ").xls]ACIC Weekly Conversion Report - Auto Attr (" rYear & rMonth & rDay ")'!$B$2:$K$65536,5,FALSE)"
 
After a first look (to make it generate a valid string):
Code:
"=VLOOKUP($E5-BI,'G:\ACIC Weekly Conversion Report\OH\1Data\[ACIC Weekly Conversion Report - Auto Attr (" & rYear & rMonth & rDay & ").xls]ACIC Weekly Conversion Report - Auto Attr (" & rYear & rMonth & Rday & ")'!$B$2:$K$65536,5,FALSE)/VLOOKUP($E5-PD,'G:\ACIC Weekly Conversion Report\OH\1Data\[ACIC Weekly Conversion Report - Auto Attr (" & rYear & rMonth & rDay & ").xls]ACIC Weekly Conversion Report - Auto Attr (" & rYear & rMonth & rDay & ")'!$B$2:$K$65536,5,FALSE)"
Hope this helps

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Thanks Harley... I had to make a slight tweak, but it works now!
 
Glad I could help [smile]

HarleyQuinn
---------------------------------
Carter, hand me my thinking grenades!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers before posting.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top