Wrapping text in VBA Code

P

Pete

How do you change this code:

Range("Bcard2").FormulaR1C1 = _
"=IF(card2=1,""A"",if(card2=11,""J"",if(card2=12,""Q"",if
(card2=13,""K"",card2))))"

Into this:

Range("Bcard2").FormulaR1C1 = _
"=IF(card2=1,""A"", _
if(card2=11,""J"", _
if(card2=12,""Q"", _
if(card2=13,""K"",card2))))"

Without getting a complied error stating that excel
expects an "end statement".

Thanks
 
C

Chip Pearson

Pete,

Use something like

Range("Bcard2").FormulaR1C1 = _
"=IF(card2=1,""A"" ," & _
"if(card2=11,""J"" ," & _
"if(card2=12,""Q"" ," & _
"if(card2=13,""K"",card2))))"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
P

Pete

Thanks Chip it worked great.

Pete
-----Original Message-----
Pete,

Use something like

Range("Bcard2").FormulaR1C1 = _
"=IF(card2=1,""A"" ," & _
"if(card2=11,""J"" ," & _
"if(card2=12,""Q"" ," & _
"if(card2=13,""K"",card2))))"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com






.
 
Top