Using Chr(10) and referencing cell

deduwa

Board Regular
Joined
Jul 28, 2015
Messages
110
Hi - I am having some problems with the following (which I am trying to solve in stages).

Ultimately I want to cell to read (spanning over 2 lines);

Final Score October (if weekly)
or September (if monthly)


The text 'October' sits in cell M2 of LastGame worksheet and is subject to change
The text 'September' sits in cell M3 of LastGame worksheet and is subject to change

In cell K1 of ActiveSheet, the following code works;

ActiveCell.FormulaR1C1 = "=CONCATENATE(""Final Score"" & "" "" & LastGame!R[1]C[2]) & "" (if weekly)"" & "" or"""

However, I want the word "or" to go onto the next line in the same cell. When I try the following, it returns #NAME ? in the cell;

ActiveCell.FormulaR1C1 = "=CONCATENATE(""Final Score"" & "" "" & LastGame!R[1]C[2]) & "" (if weekly)"" & Chr(10) & "" or"""

Once I resolve this I then want that second line to concatenate the word "or" with the month in cell M3 of LastGame worksheet and then followed by "if monthly"
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try this:

Code:
Range("K1").FormulaR1C1 = "=""Final Score ""&Lastgame!R2C13&"" (if weekly)""&CHAR(10)&""or ""&Lastgame!R3C13&"" (if monthly)"""
 
Upvote 0
Thanks Steve - that mostly works. However the output appears only on 1 line and not 2. I changed the CHAR to Chr and that still didn't work.
 
Upvote 0
Select the column & click "Wrap Text" on the Home Tab
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,216,124
Messages
6,128,979
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top