Mega Code Archive

 
Categories / VisualBasic Script / Excel
 

Shade every second row by using the Do Loop

Sub ShadeEverySecondRow()          Dim lRow As Long          lRow = 0          Do              lRow = lRow + 2              If IsEmpty(cells(lRow, 1)) Then Exit Do              Rows(lRow).Interior.ColorIndex = 15          Loop      End Sub