The following Macro sets the StartCell as $A4 but that is not always the case so I'd like to set it as the ActiveCell. JUst not sure how to do that. I appreciate any help anyone can offer me. Thanks EVan
[VBA]
Sub FormatCellFill()
Dim R As Range
Dim LastRow As Long
Dim ColorIndex As Long
Dim InFill As Boolean
Dim N As Long
Dim ColorWidthColumns As Long
Dim StartCell As String
Dim DataTestColumn As String
ColorIndex = 20 'light blue '<<<<<< Set color index
InFill = True '<<<<< True -> Color first group, False-> No color first group
ColorWidthColumns = 12 '<<<< how many columns wide to format
StartCell = "$A4” '<<<< where to start the banding
DataTestRow = “ ” '<<<< column number containing data to test
Set R = Range(StartCell)
With R.Worksheet
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
N = 0
Do Until R.Row > LastRow
N = N + 1
If R.EntireRow.Cells(1, 4).Value <> vbNullString Then
If InFill = True Then
R.EntireRow.Cells(1, "A").Resize(, ColorWidthColumns).Interior.ColorIndex = ColorIndex
Else
R.EntireRow.Cells(1, "A").Resize(, ColorWidthColumns).Interior.ColorIndex = xlColorIndexNone
End If
Else
N = 0
InFill = True
End If
If N >= 30 Then
N = 0
InFill = Not InFill
End If
· Set R = R(2, 1)
· Loop
· End Sub
[/VBA]Change the lines marked with '<<<< to the appropriate values.