Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello All -
I have an IF stmt that's fairly long, and it works. Range("P2").Select ActiveCell.FormulaR1C1 = "=IF(RC[-15]=""abc"",1.5, IF(OR(RC[-1]={""xx"",""xx""}),4.0, IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx""}),3.5, IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx"",""xx""}),3, IF(OR(RC[-1]={""A6"",""AB"",""AV"",""ZU"",""xx""}),2.5, IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx"",""xx""}),2, IF(OR(RC[-1]={""A1"",""A2"",""xx""}),1.5,"""")))))))" However, if I try to break it into segments for useability, I get an "Expected: end of statement" or "Syntax Error." Range("P2").Select ActiveCell.FormulaR1C1 = "=IF(RC[-15]=""abc"",1.5, _ IF(OR(RC[-1]={""xx"",""xx""}),4.0, _ IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx""}),3.5, _ IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx"",""xx""}),3, _ IF(OR(RC[-1]={""A6"",""AB"",""AV"",""ZU"",""xx""}),2.5, _ IF(OR(RC[-1]={""xx"",""xx"",""xx"",""xx"",""xx"",""xx"",""xx"" ,""xx"",""xx""}),2, _ IF(OR(RC[-1]={""A1"",""A2"",""xx""}),1.5,"""")))))))" The ONLY difference is the multiple lines. What is the magic to breaking up a line when I want more than 1 row? KarenF |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Challenge - Excel Line Feed Character CHR(10) - How to Delete and keep the text formatting without going ro single line in a cell ? | Excel Worksheet Functions | |||
How show single line rather than multiple line with same desc in e | New Users to Excel | |||
Concatenate: Multi-Line Cell with 2 single line cells | Excel Worksheet Functions | |||
how do you execute single line of code? | Excel Discussion (Misc queries) | |||
VBA Array Population with a Single Line of Code | Excel Programming |