S
signon77
The following is the data in my spreadsheet
first second
jdjj jkkjk
sss sdd
sss fda
sa fdfd
hah klk
The following is the code I'm wrting to test it:
Sub test()
Dim r As Range
With Sheets("Sheet2")
.AutoFilterMode = False
.UsedRange.AutoFilter field:=1, Criteria1:="hah"
.UsedRange.AutoFilter field:=2, Criteria1:="klk"
Set r = .UsedRange.SpecialCells(xlCellTypeVisible)
.UsedRange.AutoFilter
End With
End Sub
Problem: Even though both the header and one row of data are clearly
visible, range "r" only ever returns the header row (r.rows.count is
always = 1 instead of 2) .
Any idea what might be causing this problem?
Rob
first second
jdjj jkkjk
sss sdd
sss fda
sa fdfd
hah klk
The following is the code I'm wrting to test it:
Sub test()
Dim r As Range
With Sheets("Sheet2")
.AutoFilterMode = False
.UsedRange.AutoFilter field:=1, Criteria1:="hah"
.UsedRange.AutoFilter field:=2, Criteria1:="klk"
Set r = .UsedRange.SpecialCells(xlCellTypeVisible)
.UsedRange.AutoFilter
End With
End Sub
Problem: Even though both the header and one row of data are clearly
visible, range "r" only ever returns the header row (r.rows.count is
always = 1 instead of 2) .
Any idea what might be causing this problem?
Rob