Referencing formatted cell in text

claushojmark

New Member
Joined
Jul 9, 2012
Messages
3
I'm having an issue with a formatted cell. I am trying write som text in a cell and using a cell reference to put a value in the middle of a sentence. It looks like this

Cells(122, 1).FormulaR1C1 = "This is text " & Range("B98") & " this is more text."

when it returns the cell value I get the unformatted version such as 5.0836272838939 instead of just 5.1. I tried to add .numberformat = "0.0" but it does not work. Any suggestions
?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Welcome to the board.

If the cell B98 is already formatted as you desire, try

Cells(122, 1).FormulaR1C1 = "This is text " & Range("B98").Text & " this is more text."


If the cell B98 is NOT already formatted as you desire, try

Cells(122, 1).FormulaR1C1 = "This is text " & Format(Range("B98"),"0.0") & " this is more text."
 
Upvote 0

Forum statistics

Threads
1,215,256
Messages
6,123,911
Members
449,132
Latest member
Rosie14

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