How can I tell excel to highlight every 4 rows?

A

Amanda

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

Don Guillett

One way
Sub HI()
For I = 1 To 21000 Step 4
Rows(I).Interior.ColorIndex = 6
Next I
End Sub
 
D

Don Guillett

One way
Sub HI()
For I = 1 To 21000 Step 4
Rows(I).Interior.ColorIndex = 6
Next I
End Sub
 
K

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

..
 
K

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

..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top