View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Idoia Idoia is offline
external usenet poster
 
Posts: 29
Default 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