Vba show row below selected (filtered) one

emwaj

New Member
Joined
Jan 14, 2019
Messages
12
Hey
I have a sheet (named “sheet1” with dates in column B
The data starts in row 2 (row 1 is the columns titles).
For each dates there are 2 rows . for example the first date is 01/01/2020 and it is in cell B2 (B2 and B3 are merged)

I have this macro which finds and filters the row with the chosen date in columnB (we choose the date to filter through an input box).
The problem is that the filter shows only the first row of the two (only the first row where is the date- the row 2 because date is in B2).
I need to show also one row below the filtered row that’s to say, with this same example, to show rows 2 and 3

can anyone helps me?
Thanks for your help!! :)

sub test()

Worksheets(“sheet1”).activate
Strinput= InputBox (“insert the date you want to show”, “find date”, “”)
ActiveCell.AutoFilter field:=2, criteria1:=strinput
ActiveSheet.AutoFilter.Range.Offset(1, 0).Rows.SpecialCells(xlCellTypeVisible).Select

End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
VBA Code:
Rows(ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Row + 1).Hidden = False
 
Upvote 0
Solution

Forum statistics

Threads
1,215,002
Messages
6,122,652
Members
449,092
Latest member
peppernaut

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