Is it possible to keep a text/cell color/formatting in general in a reference?

Hollywoood

Board Regular
Joined
Aug 11, 2011
Messages
53
Hi all,

I am trying to populate one worksheet with values from several others which is easy enough. I then have formulas to perform opperations on this sheet based on the cells text color or fill color or bold/italic etc. These also work fine on their own.

What Id like to do is have the final worksheet populate automatically from the source sheets but to keep their cell formatting be it text color, fill color, etc. Is something like this possible? So the very basic would be set cell B1 = A1 but not just contents but also formatting.

Thanks in advance!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Hi Hollywood,

I am trying to populate one worksheet with values from several others which is easy enough.

What process or VBA code are you currently using to do this?

If you are using VBA code, can probably modify it slightly to use any one of the methods below
to copy both Values and Formats together.

Code:
SourceRange.Copy Destination:= TargetRange

Code:
SourceRange.Copy
TargetRange.PasteSpecial (xlPasteAll)

Code:
SourceRange.Copy
TargetRange.PasteSpecial (xlPasteValues)
TargetRange.PasteSpecial (xlPasteFormats)
 
Upvote 0
Thanks for the reply Jerry, I hadnt actually explored VBA yet as I am not particularly versed in it so I had hoped there might have just be a special copy command I havent come across. Doesnt sound like it though.
 
Upvote 0
Thanks for the reply Jerry, I hadnt actually explored VBA yet as I am not particularly versed in it so I had hoped there might have just be a special copy command I havent come across. Doesnt sound like it though.

How are currently populating the cells?
Your formatting should be copied with the values with a manual Copy and Paste process.
 
Upvote 0
A few different ways JS but mostly simple =IF(...) statements relying on date or value criteria. The number is being copied but I have other formulas that rely on it being bold/italic/regular or its text/fill color.

The problem is that everything is being copied as regular default black arial size 10 etc.
 
Upvote 0
Ok- now I understand that you are populating the cells in the Target Worksheet with formula references to the Source Worksheet.

No, there isn't a way to have your worksheet formulas transfer the cell formatting of the referenced.

You can use conditional formatting to change the formatting of the your cells based on the value. This isn't the same as transfering the formatting from the referenced cells, but if you have a small number of cases it might work.

The number is being copied but I have other formulas that rely on it being bold/italic/regular or its text/fill color.

Can you give an example of one of those formulas?
The CELL() function can read font property, but I'm not aware of any worksheet formulas that read fill color (without using VBA).
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,421
Members
452,913
Latest member
JWD210

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