ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Copy cell contents depending on font colour (https://www.excelbanter.com/excel-worksheet-functions/230479-copy-cell-contents-depending-font-colour.html)

alistew

Copy cell contents depending on font colour
 
Hi

I am looking to copy the contents from one cell to another depending on the
font colour. ie if i have information in cell A1 which turns to red then the
information is then copied to B1?

I have tried using basic vba code under Worksheet change but its not working
properly. I would like the info copied when the font colour changes not the
actual text.

Below is the code i tried.

Thanks
alison

Option Explicit



Private Sub Worksheet_Change(ByVal Target As Range)


Range("A1").Select

If Range("a1").Font.ColorIndex = 3 Then

Selection.Copy
Range("D1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End If

End Sub



All times are GMT +1. The time now is 05:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com