I'm trying to find a code in excel macro that can address the following problem.
If the first column contains any text then highlight the first column cells with a certain color until next text doesn't appear in the same column. When any text appears in the same column, start coloring the cells with different color.
I have to repeat this for all the worksheets in my workbook. Thanks.
Right now I'm using this macro to colour the cells which are empty but the problem is the color doesnot change whenever a text is encountered
Sub try()
Dim i As Integer
Dim j As Integer
Dim k As Integer
i = 200
j = 100
k = 5
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
.AutoFilter Field:=1, Criteria1:=""
If WorksheetFunction.CountBlank(.Columns(1)) > 0 Then
.Columns(1).SpecialCells(xlCellTypeBlanks).Interior.Color = RGB(i, j, k)
Else
i = i - 50
j = j - 10
k = 255
End If
.AutoFilter
End With
Application.ScreenUpdating = True
End Sub