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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
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,522
Messages
6,120,020
Members
448,939
Latest member
Leon Leenders

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