Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I'm having some issue with this code and I'm not certain where I need to make corrections.
In my database, rows 1 and 2 are header rows. When I run the filter, row 2, a header row is hidden with this code.
Code:
With ws_sdata
If .AutoFilterMode = True Then .AutoFilterMode = False
lrow = .Cells(.Rows.Count, "B").End(xlUp).Row
Set filter_rng = .Range("A3:A" & lrow)
.Range("A3").AutoFilter Field:=2, Criteria1:=inqtofind & "*"
For y = 1 To .Range("B3").CurrentRegion.Rows.Count
If .Cells(y, 2).EntireRow.Hidden = False Then
zcount = zcount + 1
End If
Next y
End With
In my database, rows 1 and 2 are header rows. When I run the filter, row 2, a header row is hidden with this code.