sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
Hi,
I think this should be easy, but the more I tinker with it, I get the same results. The code below is called from the workbook open event. I want it to see if "Autofilter" is turned on for my "table1". If it is on, I want it to stay on, if it is off, I want it turned on. The code I have below just turns it on if it is off or turns it on if it is on when I open the workbook. Please help.
Thanks, SS
I think this should be easy, but the more I tinker with it, I get the same results. The code below is called from the workbook open event. I want it to see if "Autofilter" is turned on for my "table1". If it is on, I want it to stay on, if it is off, I want it turned on. The code I have below just turns it on if it is off or turns it on if it is on when I open the workbook. Please help.
Thanks, SS
VBA Code:
Sub AutoFilterCheck()
If ActiveSheet.AutoFilterMode = True Then
MsgBox "Auto Filter is turned on"
Else
MsgBox "Auto Filter is turned off"
Worksheets("PO History").ListObjects("Table1").Range.AutoFilter
End If
End Sub