Filter rows base on the list

zzblitzz

New Member
Joined
Jun 25, 2013
Messages
8
H
I thank you for helping me with this. the situation is on the 1st sheet contains several numbers lined up in column A, this number represents the row number on sheet 2 ( sheet 2 contains the data)

I there a way in macro or ay means that I can filter sheet 2 that only shows whats is being filtered in sheet 1

ex in sheet 1 column A, it s 2,4,5,7,9
then in sheet two it is filtered and only shows row 2,4,5,7,9?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
H
I thank you for helping me with this. the situation is on the 1st sheet contains several numbers lined up in column A, this number represents the row number on sheet 2 ( sheet 2 contains the data)

I there a way in macro or ay means that I can filter sheet 2 that only shows whats is being filtered in sheet 1

ex in sheet 1 column A, it s 2,4,5,7,9
then in sheet two it is filtered and only shows row 2,4,5,7,9?

Try this:

Code:
Sub a1077373a()
Dim r As Range
    With Sheets("Sheet2")
    .Range("A2", .Cells(Rows.count, "A").End(xlUp)).Rows.Hidden = True
    
        For Each r In Sheets("Sheet1").Range("A2", Sheets("Sheet1").Cells(Rows.count, "A").End(xlUp))
            If IsNumeric(r) Then .Rows(r).Hidden = False
        Next
    
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,216,459
Messages
6,130,758
Members
449,588
Latest member
accountant606

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