Hi, i have this code below but it fills the entire row with gray color. I only want it to fill from columns A to F. Thanks
Application.ScreenUpdating = False
Dim lngLstCol As Long, lngLstRow As Long
lngLstRow = ActiveSheet.UsedRange.Rows.Count
lngLstCol = ActiveSheet.UsedRange.Columns.Count
For Each RngCell In Range("A19:A" & lngLstRow)
If RngCell.Value > "" Then
r = RngCell.row
C = RngCell.Column
Range(Cells(r, C), Cells(r, lngLstCol)).Select
With Selection.Borders
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
If RngCell.row Mod 2 = 1 Then RngCell.EntireRow.Interior.ColorIndex = 15
End If
Next
Application.ScreenUpdating = True
Bookmarks