ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How can I tell excel to highlight every 4 rows? (https://www.excelbanter.com/excel-discussion-misc-queries/231742-how-can-i-tell-excel-highlight-every-4-rows.html)

Amanda

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

Don Guillett

How can I tell excel to highlight every 4 rows?
 
One way
Sub HI()
For I = 1 To 21000 Step 4
Rows(I).Interior.ColorIndex = 6
Next I
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

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



Ken Johnson

How can I tell excel to highlight every 4 rows?
 
On May 23, 7:58*am, Amanda wrote:
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

..



All times are GMT +1. The time now is 06:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com