Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,562
- Office Version
- 365
- 2016
- Platform
- Windows
I hope this snippit of my code below is enough to isolate the problem I'm having
This code is intended to filter my database (ws_data) using the criteria at worksheet ws_vh.range("F47:G48"). Once the list has been filtered, code is in place to get the minimum and maximum values (times) from columns N and O respectively from worksheet ws_data.
The filter is coming up empty (despite the values of filter existing in both criteria of headers at F and G 47)
Rich (BB code):
If wpe > 0 Then
With ws_data
If .FilterMode And Not .AutoFilterMode Then
.ShowAllData
End If
ws_vh.Range("F48") = "Waterloo Park"
ws_vh.Range("G48") = "WPE"
Set rng_af1_criteria = ws_vh.Range("F47:G48")
.Range("A:EL").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=rng_af1_criteria
wpemin = WorksheetFunction.Subtotal(105, .Range("N:N"))
wpemax = WorksheetFunction.Subtotal(104, .Range("O:O"))
If .FilterMode And Not .AutoFilterMode Then
.ShowAllData
End If
End With
End If
If wpw > 0 Then
With ws_data
If .FilterMode And Not .AutoFilterMode Then
.ShowAllData
End If
ws_vh.Range("F48") = "Waterloo Park"
ws_vh.Range("G48") = "WPW"
Set rng_af1_criteria = ws_vh.Range("F47:G48")
.Range("A:EL").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=rng_af1_criteria
wpwmin = WorksheetFunction.Subtotal(105, .Range("N:N"))
wpwmax = WorksheetFunction.Subtotal(104, .Range("O:O"))
If .FilterMode And Not .AutoFilterMode Then
.ShowAllData
End If
End With
End If
This code is intended to filter my database (ws_data) using the criteria at worksheet ws_vh.range("F47:G48"). Once the list has been filtered, code is in place to get the minimum and maximum values (times) from columns N and O respectively from worksheet ws_data.
The filter is coming up empty (despite the values of filter existing in both criteria of headers at F and G 47)