I need to check a spreadsheet and highlight any cell that is empty in Col F. The Col will have either M or F or nothing in the cells. Can anyone help? This will go into an already working code on the same sheet.
Alan
I need to check a spreadsheet and highlight any cell that is empty in Col F. The Col will have either M or F or nothing in the cells. Can anyone help? This will go into an already working code on the same sheet.
Alan
Hi,
Try, for example, something like this (this code highlights cells by changing interior to yellow):Originally Posted by drums4monty
Sub HighligthCells() Dim Xc As Range For Each Xc In Range("f1", Range("f65535").End(xlUp)) If Xc.Value = "" Then Xc.Interior.ColorIndex = 6 Next Range(Range("f65535").End(xlUp).Offset(1,0),"f65535").Interior.ColorIndex = 6 End Sub
One Hundred MS Excel Games
Sub HiLiteBlanks() Dim rng As Range Set rng = Range("F1").Resize(Cells(Rows.Count, "F").End(xlUp).Row) rng.Select With Selection .FormatConditions.Delete .FormatConditions.Add Type:=xlExpression, Formula1:="=" & rng.Cells(1, 1).Address(0, 0) & "=""""" .FormatConditions(1).Interior.ColorIndex = 3 End With MsgBox "Number of blanks = " & Application.CountIf(rng, "") End Sub
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber