rollingzep
Board Regular
- Joined
- Nov 18, 2013
- Messages
- 215
- Office Version
- 365
- Platform
- Windows
<p>
I am trying to enter this lengthy formula in multi line but it is incorrect
How to enter the correct way?
I tried a space and an underscore, and as below but it is incorrect </p>
<code>
lrow = ws.Cells(Rows.Count, "BC").End(xlUp).Row
ws.Range("BC2").Formula =
"=IF(BE2=""A-0"",""1"",IF(BE2=""A-1"",""1"",IF(BE2=""A-2"",""1"",IF(BE2=""A-3"",""1"", " & _
"IF(BE2=""A-4"",""1"",IF(BE2=""A-5"",""1"",IF(BE2=""S-1"",""1"",IF(BE2=""S-2"",""1"", " & _
"IF(BE2=""S-3"",""1"",IF(BE2=""S-4"",""1"",IF(BE2=""G-1"",""2A"",IF(BE2=""G-2"",""2A"", " & _
"IF(BE2=""G-3"",""2A"",IF(BE2=""S-5"",""2A"",IF(BE2=""S-6"",""2A"",IF(BE2=""S-7"",""2A"", " & _
"IF(BE2=""E-1"",""2B"",IF(BE2=""E-2"",""2B"",IF(BE2=""IG-1"",""2B"",IF(BE2=""IG-2"",""2B"", " & _
"IF(BE2=""S-8"",""N"",IF(BE2=""G-4"",""N"",IF(BE2=""E-3"",""N"",IF(BE2=""E-4"",""N"", " & _
"IF(BE2=""IG-3"",""N"",IF(BE2=""IG-4"",""N"",IF(BE2=""IG-5"",""N"",IF(BE2=""IG-6"",""N"", " & _
"IF(BE2=""IG-7"",""N"",IF(BE2=""N-1"",""N"",IF(BE2=""N-2"",""N"",IF(BE2=""N-3"",""N"", " & _
"IF(BE2=""N-4"",""N"",IF(BE2=""N-5"",""N"",IF(BE2=""N-6"",""N"",IF(BE2=""N-7"",""N"", " & _
"IF(BE2=""L-1"",""N"",IF(BE2=""L-2"",""N"",IF(BE2=""L-3"",""N"",IF(BE2=""L-4"",""N"", " & _
"IF(BE2=""L-5"",""N"",IF(BE2=""L-6"",""N"",IF(BE2=""L-7"",""N"",IF(BE2=""L-8"",""N"", " & _
"IF(BE2=""L-9"",""N"",IF(BE2=""L-10"",""N"",IF(BE2=""L-11"",""N"", " & _
"IF(BE2=""Y-1"",""N"",IF(BE2=""Y-2"",""N"",IF(BE2=""Y-3"",""N"",IF(BE2=""C-1"",""N"", " & _
"IF(BE2=""Z-1"",""N""))))))))))))))))))))))))))))))))))))))))))))))))))))"
</code>
I am trying to enter this lengthy formula in multi line but it is incorrect
How to enter the correct way?
I tried a space and an underscore, and as below but it is incorrect </p>
<code>
lrow = ws.Cells(Rows.Count, "BC").End(xlUp).Row
ws.Range("BC2").Formula =
"=IF(BE2=""A-0"",""1"",IF(BE2=""A-1"",""1"",IF(BE2=""A-2"",""1"",IF(BE2=""A-3"",""1"", " & _
"IF(BE2=""A-4"",""1"",IF(BE2=""A-5"",""1"",IF(BE2=""S-1"",""1"",IF(BE2=""S-2"",""1"", " & _
"IF(BE2=""S-3"",""1"",IF(BE2=""S-4"",""1"",IF(BE2=""G-1"",""2A"",IF(BE2=""G-2"",""2A"", " & _
"IF(BE2=""G-3"",""2A"",IF(BE2=""S-5"",""2A"",IF(BE2=""S-6"",""2A"",IF(BE2=""S-7"",""2A"", " & _
"IF(BE2=""E-1"",""2B"",IF(BE2=""E-2"",""2B"",IF(BE2=""IG-1"",""2B"",IF(BE2=""IG-2"",""2B"", " & _
"IF(BE2=""S-8"",""N"",IF(BE2=""G-4"",""N"",IF(BE2=""E-3"",""N"",IF(BE2=""E-4"",""N"", " & _
"IF(BE2=""IG-3"",""N"",IF(BE2=""IG-4"",""N"",IF(BE2=""IG-5"",""N"",IF(BE2=""IG-6"",""N"", " & _
"IF(BE2=""IG-7"",""N"",IF(BE2=""N-1"",""N"",IF(BE2=""N-2"",""N"",IF(BE2=""N-3"",""N"", " & _
"IF(BE2=""N-4"",""N"",IF(BE2=""N-5"",""N"",IF(BE2=""N-6"",""N"",IF(BE2=""N-7"",""N"", " & _
"IF(BE2=""L-1"",""N"",IF(BE2=""L-2"",""N"",IF(BE2=""L-3"",""N"",IF(BE2=""L-4"",""N"", " & _
"IF(BE2=""L-5"",""N"",IF(BE2=""L-6"",""N"",IF(BE2=""L-7"",""N"",IF(BE2=""L-8"",""N"", " & _
"IF(BE2=""L-9"",""N"",IF(BE2=""L-10"",""N"",IF(BE2=""L-11"",""N"", " & _
"IF(BE2=""Y-1"",""N"",IF(BE2=""Y-2"",""N"",IF(BE2=""Y-3"",""N"",IF(BE2=""C-1"",""N"", " & _
"IF(BE2=""Z-1"",""N""))))))))))))))))))))))))))))))))))))))))))))))))))))"
</code>