Preserve font color in VBA

Mark Boyle

New Member
Joined
Oct 17, 2011
Messages
1
I am using the below code to append user initials + date to existing text within a cell and this is successful.

ActiveCell.FormulaR1C1 = ActiveCell.FormulaR1C1 & vbLf & Initials & InitDate & ": "

However I have not been able to preserve the font color in the existing text, where some words have been highlighted in red, as per the following example "Please refer to the Builders Almanac for further details."

Is there any way to preserve the font colors assigned to the existing text?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Welcome to MrExcel.

Sorry, you can't apply rich text formatting to the resut of a formula. You would have to convert the formula to a value and format the relevant characters.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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