I have a workbook that has multiple sheets from multiple linked datasources. I would like to have a Dashboard page that I am able to select a type a date range in B1 and C1 (start and end date) and it filter Column A in all of the other worksheets. I found the code below, but this looks at the Range(B1) and Range(C1) in their respective sheets not back to the "Dashboard" where the dates would have been set.
Sub apply_autofilter_across_worksheets()
'Updateby Extendoffice 20160623
Dim xWs As Worksheet
On Error Resume Next
For Each xWs In Worksheets
xWs.Range("A1").AutoFilter 1, Criteria1:=">=Range(B1)", Operator:=xlAnd, Criteria2:="<=Range(C1)"
Next
End Sub
Thanks for time in advance
Sub apply_autofilter_across_worksheets()
'Updateby Extendoffice 20160623
Dim xWs As Worksheet
On Error Resume Next
For Each xWs In Worksheets
xWs.Range("A1").AutoFilter 1, Criteria1:=">=Range(B1)", Operator:=xlAnd, Criteria2:="<=Range(C1)"
Next
End Sub
Thanks for time in advance