create a variable to represent the colour of a cell

alison233

New Member
Joined
Oct 30, 2009
Messages
30
Can anyone help please. I want to create a variable to represent the colour of a cell, so that I can later make a different cell the same colour. (This is in the middle of a more complex and repeated operation, so I can't just copy the colour from one cell to another).

Could anyone help please?

Thanks very much

Alison
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Thanks very much Andrew - I was struggling to find the right words but have now found the following wchih seems to work

alison = Cells(R, c).Interior.ColorIndex

and then when I want to use the colour on another cell

Cells(lrd + 1, 1).Interior.ColorIndex = alison

This seems to work . . .

Very best wishes

Alison
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,879
Messages
6,122,065
Members
449,064
Latest member
scottdog129

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