SanjayGMusafir
Well-known Member
- Joined
- Sep 7, 2018
- Messages
- 1,513
- Office Version
- 2024
- Platform
- Windows
Hi Experts
I need to use value of active cell from current sheet as a filter on another sheet. I tried my hands on it but for sure I'm missing something...
The code I tried is here under
Please help
Thanks
I need to use value of active cell from current sheet as a filter on another sheet. I tried my hands on it but for sure I'm missing something...
The code I tried is here under
Please help
Thanks
VBA Code:
Sub VisitsFilterCurrent()
'
' VisitsFilterCurrent Macro
'
'Application.Calculate
Dim x1 As Range
Set x1 = ActiveSheet.ActiveCell.Select 'This seems to be the problem area
Sheets("Visits").Select
Call VisitsSortBack
ActiveSheet.ListObjects("Visits").Range.AutoFilter Field:=1, Criteria1:=x1.Value
Range("Visits[[#Headers],[QType]]").End(xlDown).Select
On Error Resume Next
Err.Clear
ActiveSheet.ListObjects("Visits").ShowAutoFilterDropDown = False
'ActiveWorkbook.Save
End Sub