Hi, How can I copy a colour of a cell to another cell, using a function or a macro? Thanks, Assaf.
A assaf1978 Aug 27, 2008 #1 Hi, How can I copy a colour of a cell to another cell, using a function or a macro? Thanks, Assaf.
S Sheeloo Aug 27, 2008 #2 Try Sub CopyColor() Range("B2").Select With Selection.Interior .Pattern = Range("A2").Interior.Pattern .Color = Range("A2").Interior.Color End With End Sub
Try Sub CopyColor() Range("B2").Select With Selection.Interior .Pattern = Range("A2").Interior.Pattern .Color = Range("A2").Interior.Color End With End Sub
T TomPl Aug 27, 2008 #3 If you are familiar with VBA (Macros) the following code will copy the color of F7 to A1 on the active worksheet: Sub copycolor() ActiveSheet.Range("A1").Interior.ColorIndex = ActiveSheet.Range("F7").Interior.ColorIndex ActiveSheet.Range("A1").Interior.Pattern = ActiveSheet.Range("F7").Interior.Pattern End Sub If you are not familiar with VBA then more information about what you are trying to do would be necessary. Tom
If you are familiar with VBA (Macros) the following code will copy the color of F7 to A1 on the active worksheet: Sub copycolor() ActiveSheet.Range("A1").Interior.ColorIndex = ActiveSheet.Range("F7").Interior.ColorIndex ActiveSheet.Range("A1").Interior.Pattern = ActiveSheet.Range("F7").Interior.Pattern End Sub If you are not familiar with VBA then more information about what you are trying to do would be necessary. Tom
G Gord Dibben Aug 27, 2008 #4 Functions cannot change formatting of a cell so it must be a macro. Sub colorit() ActiveCell.Interior.ColorIndex = _ Range("A1").Interior.ColorIndex End Sub Or use the Format PaintBrush Gord Dibben MS Excel MVP
Functions cannot change formatting of a cell so it must be a macro. Sub colorit() ActiveCell.Interior.ColorIndex = _ Range("A1").Interior.ColorIndex End Sub Or use the Format PaintBrush Gord Dibben MS Excel MVP