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
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,358
VBA Code:
Rows(ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Row + 1).Hidden = False
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,118,800
Messages
5,574,404
Members
412,590
Latest member
Velly
Top