Detecting particular BG Color in one cell and duplicate it in anot

R

RidgeView

Excel 2007....I have two worksheets where I need to detect a particular cell
background color in one of the worksheets and duplicate in another (not the
same formated sheet). I need to do this in a VBA Macro. I hope this is
enough information.....
 
B

Bernie Deitrick

Try

Different workbooks:
Workbooks("Workbook Name 2.xls").Worksheets("Sheet Name 2").Range("B2").Interior.ColorIndex = _
Workbooks("Workbook Name 1.xls").Worksheets("Sheet Name 1").Range("A1").Interior.ColorIndex

Different worksheets within the same workbook:
Worksheets("Sheet Name 2").Range("B2").Interior.ColorIndex = _
Worksheets("Sheet Name 1").Range("A1").Interior.ColorIndex

Note that this may not work if either cell has conditional formatting....

HTH,
Bernie
MS Excel MVP
 
Top