![]() |
Automatically Highlight every 22nd row
I have a sheet of over 750 rows of data and need to pick out every
22nd row for an audit. Is there a way to get Excel to highlight every 22nd row in steed of manually counting every 22 row and highlighting Thanks, Paul |
Automatically Highlight every 22nd row
Paul,
The following macro will highlight every 22nd row up to row 770. Sub Highlight() For i = 1 To 35 ActiveWorkbook.ActiveSheet.Rows(i * 22).Select With Selection.Interior .ColorIndex = 44 .Pattern = xlSolid End With Next End Sub If you need to cover more than 770 lines, increase the 35 in the second line to a higher number. If you need to highlight every 22nd row, but starting in row 23 (ie, if you have a 1st row with headings), change the 3rd line of the code to: ActiveWorkbook.ActiveSheet.Rows(i * 22 + 1).Select "Paul" wrote: I have a sheet of over 750 rows of data and need to pick out every 22nd row for an audit. Is there a way to get Excel to highlight every 22nd row in steed of manually counting every 22 row and highlighting Thanks, Paul |
Automatically Highlight every 22nd row
Hi,
Select your 750 rows then Format|conditional format|Formula is enter the formula =MOD(ROW( ),22)=0 Pick a colour Click OK Mike "Paul" wrote: I have a sheet of over 750 rows of data and need to pick out every 22nd row for an audit. Is there a way to get Excel to highlight every 22nd row in steed of manually counting every 22 row and highlighting Thanks, Paul |
All times are GMT +1. The time now is 05:30 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com