PSS ID Number: 142139
Article Last Modified on 8/19/2003
Sub ShadeEveryOtherRow()
Dim Counter As Integer
'For every row in the current selection...
For Counter = 1 To Selection.Rows.Count
'If the row is an odd number (within the selection)...
If Counter Mod 2 = 1 Then
'Set the pattern to xlGray16.
Selection.Rows(Counter).Interior.Pattern = xlGray16
End If
Next
End Sub
Tell me about autoformatFor more information about Visual Basic Constants, click Answer Wizard on the Help menu and type:
Visual Basic ConstantsFor additional information about getting help with Visual Basic for Applications, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: 163435 TITLE : VBA: Programming Resources for Visual Basic for Applications
Additional query words: 5.00a 5.00c 8.00 XL97 XL7 XL5 XL
Keywords: kbdtacode kbhowto kbProgramming KB142139
Technology: kbExcel97Search kbExcelSearch kbExcelWinSearch kbVBASearch kbZNotKeyword3 kbZNotKeyword6