Cell interior.color = different cell.interior.color

Alpacino

Well-known Member
Joined
Mar 16, 2011
Messages
511
How would u write a code for example :

Range("B1").interior.color = range("A1").interior.color

???

I would like B1 to have sane Color as A1
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Don't know if I have this bit right or part pf bigger code that is wrong


Sub colorcopy

Dim cell as range
Dim x as integer
Dim y as integer

On error resume next
For each cell in range("A3:A35")
x = match(sheet1.range("A4"),sheet2.range("A3:A35"),0)+3
y = match(cell,sheet2.range("A3:AA3"),0)

Cell.offset(0,7).interior.color =*
Sheet2.cells(x,y).interior.color

Next cell

End Sub
 
Upvote 0
"Don't know if I have this bit right".
Neither do I.
What do you want that code to do? What is/isn't it doing?
 
Upvote 0
I have one sheet with names and kpis with red yellow green blue interior to measure performance.

In sheet 2 I have a summary of one name. I want to mirror the color interior in sheet 1 to sheet 2 next to Kpis
 
Upvote 0
The only odd syntax that I see is this
Cell.offset(0,7).interior.color =*
Sheet2.cells(x,y).interior.color

You might try
Code:
Cell.offset(0,7).Interior.Color = Sheet2.Cells(x,y).Interior.Color
 
Upvote 0
Hi,

Finally made it work. Stepinto code F8 it to see what was happening and could you believe the Lookup range was slightly out so wasn't working correctly.

it works now !!!

thanks for your help.
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

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