Considere o seguinte código de uma macro em VBA para Excel.
Sub MySub()
Dim Myrange As Range
Dim Myrow As Range
Set Myrange = Selection
For Each Myrow In Myrange.Rows
If Myrow.Row Mod 2 = 1 Then
Myrow.Interior.Color = vbBlue
End If
Next Myrow
End Sub
O efeito da execução dessa rotina consiste em