watch selected rows

gsrikanth

Board Regular
Joined
Jan 7, 2012
Messages
210
my all rows are in hidden
i want see only selected rows

i want to see only multiple of 2 like 2,4,6,8 rows
multiple of 3
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
If any rows are hidden with an AutoFilter, this won't work. Otherwise, this will hide all rows on the activesheet except the ones that match your input value:
Code:
Sub ShowOnlyCertainRows()
Dim RowNum As Long, LR As Long, Rw As Long

RowNum = Application.InputBox("Show rows that are multiple of what number?", "Multiples of...", 3, Type:=1)
If RowNum = 0 Then Exit Sub

Application.ScreenUpdating = False
With ActiveSheet
    .UsedRange.Rows.Hidden = False       'unhides all rows, doesn't work on AutoFilter

    LR = .Range("A" & .Rows.Count).End(xlUp).Row

    For Rw = 1 To LR
        If .Range("A" & Rw).Row Mod RowNum <> 0 Then .Rows(Rw).Hidden = True
    Next Rw
End With
Application.ScreenUpdating = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,819
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top