Created
August 25, 2010 04:36
-
-
Save jsanti/548863 to your computer and use it in GitHub Desktop.
Revisions
-
jsanti renamed this gist
Sep 2, 2010 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jsanti created this gist
Aug 25, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ ' Color row grops in Excel with alternating colors Public Sub HighLightRows() Dim i As Integer i = 3 Dim color1 As Integer color1 = 2 'white Dim color2 As Integer color2 = 15 'gray Dim c As Integer c = color1 Dim currid As String currid = "" Do While (Cells(i, 1) <> "") If currid <> Cells(i, 1) Then currid = Cells(i, 1) If c = color1 Then c = color2 Else c = color1 End If End If Rows(Trim(Str(i)) + ":" + Trim(Str(i))).Interior.ColorIndex = c i = i + 1 Loop End Sub