How can I tell excel to highlight every 4 rows?

  • Thread starter Thread starter Amanda
  • Start date Start date
A

Amanda

I need to highlight every 4 rows in my spreadsheet. How do I do this? I
have 21000 rows to sort through. :(
 
One way
Sub HI()
For I = 1 To 21000 Step 4
Rows(I).Interior.ColorIndex = 6
Next I
End Sub
 
One way
Sub HI()
For I = 1 To 21000 Step 4
Rows(I).Interior.ColorIndex = 6
Next I
End Sub
 
I need to highlight every 4 rows in my spreadsheet.  How do I do this?  I
have 21000 rows to sort through.  :(

Can also be done using conditional formatting with...

Formula Is =MOD(INT((ROW(1:1)-1)/4),2)=0

which applies the chosen highlight colour to the 1st to 4th, 9th to
12th etc rows in the cells that were selected before the conditional
formatting was applied,OR...

Formula Is =MOD(INT((ROW(1:1)-1)/4),2)=1

which applies the chosen highlight colour to the 5th to 8th, 13th to
16th etc rows in the cells that were selected before the conditional
formatting was applied.

Ken Johnson

..
 
I need to highlight every 4 rows in my spreadsheet.  How do I do this?  I
have 21000 rows to sort through.  :(

Can also be done using conditional formatting with...

Formula Is =MOD(INT((ROW(1:1)-1)/4),2)=0

which applies the chosen highlight colour to the 1st to 4th, 9th to
12th etc rows in the cells that were selected before the conditional
formatting was applied,OR...

Formula Is =MOD(INT((ROW(1:1)-1)/4),2)=1

which applies the chosen highlight colour to the 5th to 8th, 13th to
16th etc rows in the cells that were selected before the conditional
formatting was applied.

Ken Johnson

..
 
Back
Top