Wrapping text in VBA Code

  • Thread starter Thread starter Pete
  • Start date Start date
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
 
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
 
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






.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top