Sub msg() ActiveWorkbook.Sheets("Sheet1").Activate Range("D1").Select If Selection.Font.ColorIndex = 3 Then msgbox "RED!" Else msgbox "NO RED!" End If End Sub
then font colour = X and pattern colour = Y
then font colour = X and pattern colour = Z
then font colour = W and pattern colour = none
I can copy the conditional formatting horizontally without any problem but when I try to copy vertically it screws up as the next cell down in the schedule is trying to get its formatting from the cell A4 which has no date and results in no formatting
Bascially I need each of the cells in a column to reference the one header cell (all column A cells to reference cell A3 for example). It would be great if the whole of the formatting for all cells could hang off the first date cell - but I expect that is asking too much.
VB:I'm not that experienced with VBE and have been trying to learn it on the fly. Can someone take a look at this and let me know what I've done wrong?Range) If Intersect(Range, [A1:A100]) Is Nothing Then Exit Sub Application.EnableEvents = False With Target If .Value = "AP" Then .Font.ColorIndex = 15 .Font.Bold = True End If If .Value = "F - Avoidable" Then .Font.ColorIndex = 6 .Font.Bold = True End If If .Value = "F - Unavoidable" Then .Font.ColorIndex = 45 .Font.Bold = True End If If .Value = "L" Then .Font.ColorIndex = 42 .Font.Bold = True End If If .Value = "ON" Then .Font.ColorIndex = 37 .Font.Bold = True End If Else .Font.ColorIndex = xlNone .Font.Bold = False End If End With Application.EnableEvents = True End SubIf you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines