Automatically Highlight every 22nd row

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

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
 
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
 
Hi,

Select your 750 rows then

Format|conditional format|Formula is
enter the formula
=MOD(ROW( ),22)=0
Pick a colour
Click OK

Mike
 

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

Back
Top