Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple line
I have a vlookup in my code. Because the code is long I break it into two
lines but I am getting a message that says there is a syntax error. The code is as follows. Anyone can help me? Thanks. Selection.FormulaR1C1 = "=IF((ISERROR(VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0))), _ """",VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0))" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Multiple line
You cannot use the line continuation half way through a string. But you can
stop the string and concatenate another : Dim FormulaStr as string FormulaStr="=IF((ISERROR(VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0)))," & _ """"",VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0))" Selection.FormulaR1C1 = FormulaStr And note the extra " at the end of the first and begining of the first parts. NickHK "linglc" wrote in message ... I have a vlookup in my code. Because the code is long I break it into two lines but I am getting a message that says there is a syntax error. The code is as follows. Anyone can help me? Thanks. Selection.FormulaR1C1 = "=IF((ISERROR(VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0))), _ """",VLOOKUP(C[-4],Table!C[-6]:C[-5],2,0))" |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How show single line rather than multiple line with same desc in e | New Users to Excel | |||
Multiple Line Graphs | Charts and Charting in Excel | |||
display 1 line of multiple worksheets into multiple lines on 1 wks | Excel Worksheet Functions | |||
read multiple line | Excel Programming | |||
multiple line two accumulators | Excel Programming |