hiding even (or odd) rows in excel 2003

G

Guest

I am curious as how to hide even , or odd rows in 2003 , not based on
information in them but the actual row numbers themselves.

Jason
 
G

Guest

easy with a little macro:


Sub hide_um()
Application.ScreenUpdating = False
For i = 2 To 65536 Step 2
Rows(i).EntireRow.Hidden = True
Next
Application.ScreenUpdating = True
End Sub
 
R

Roger Govier

Hi Jason

One way
In a spare column enter following formula
=MOD(ROW(),2)=0
Copy down as far as required.
Highlight first cell, Data>Filter>Autofilter>select from dropdown TRUE
 
B

Bernie Deitrick

Jason,

Two ways:

Manually. Hide row 1 (or row 2). Then press F5 and enter 1:2. Press Ctrl-C, then select rows 3
through your last even numbered row that you want to hide, and press Ctrl-V.

Through Filters. Enter the formula

=MOD(ROW(),2)

into a column, through all the rows of interest. Then apply autofilters, and choose to show either
1 or 0 in that column.

HTH,
Bernie
MS Excel MVP
 
B

Bernie Deitrick

And, for completeness, you could use a macro: Select the range of rows, and run this
Sub HideRows()
Dim myRow As Range
Dim HideEven As Boolean
HideEven = MsgBox("Hide Even rows?", vbYesNo) = vbYes
For Each myRow In Selection.Rows
myRow.Hidden = False
If HideEven And myRow.Row Mod 2 = 0 Then myRow.Hidden = True
If Not HideEven And myRow.Row Mod 2 = 1 Then myRow.Hidden = True
Next myRow

End Sub
 
G

Guest

thank you to all of you for the help , i got it working , the help was much
appreciated :)

Jason
 

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