macro for hiding rows

S

Sheeloo

Try

Sub hideRows()
For i = 3 To 99 Step 3
Rows(i).EntireRow.Hidden = True
Next
End Sub

Change 99 to the value you want...
 
S

Sheeloo

Try

Sub hideRows()
For i = 3 To 99 Step 3
Rows(i).EntireRow.Hidden = True
Next
End Sub

Change 99 to the value you want...
 
S

Shane Devenshire

Hi,

Here is some code that often runs faster than loops:

Sub InsertRows()
Selection = "=1/MOD(ROW(),3)"
Selection = Selection.Value
Selection.SpecialCells(xlCellTypeConstants, 16).EntireRow.Hidden = True
Selection.EntireColumn.Delete
End Sub

Just select a blank column down as far as you want the rows to be hidden and
run it.
 
R

Rick Rothstein

Do you really want to delete the column or just clear it? My concern is if there are columns after the blank column that the user selects.
 

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