oldmaninla
New Member
- Joined
- Oct 7, 2022
- Messages
- 5
- Office Version
- 365
- Platform
- Windows
I have the following macro.
Originally, the Filter Button in Excel was in column AA but I couldn't make it work so I moved the Filter to Column A (1).
If I only want to have the filter button in Column AA how can I make my macro work?
I tried changing the AutoFilter Field:=27 but that doesn't work.
Any ideas? Thx
Sub ShowOnly_1()
'
' ShowOnly_1 Macro
'
'
Dim ws As Worksheet
For Each ws In Worksheets
'Range("AA5").Select
'ActiveSheet.Range("$AA$5:$AA$618").AutoFilter Field:=1, Criteria1:="show"
If ws.Visible = True Then
If ws.Name <> "Input" then
If ws.Name <> "Control" then
ws.Activate
ActiveSheet.Range("$A$5:$A$618").AutoFilter Field:=1, Criteria1:="show"
End If
End If
End If
Next
End Sub
Originally, the Filter Button in Excel was in column AA but I couldn't make it work so I moved the Filter to Column A (1).
If I only want to have the filter button in Column AA how can I make my macro work?
I tried changing the AutoFilter Field:=27 but that doesn't work.
Any ideas? Thx
Sub ShowOnly_1()
'
' ShowOnly_1 Macro
'
'
Dim ws As Worksheet
For Each ws In Worksheets
'Range("AA5").Select
'ActiveSheet.Range("$AA$5:$AA$618").AutoFilter Field:=1, Criteria1:="show"
If ws.Visible = True Then
If ws.Name <> "Input" then
If ws.Name <> "Control" then
ws.Activate
ActiveSheet.Range("$A$5:$A$618").AutoFilter Field:=1, Criteria1:="show"
End If
End If
End If
Next
End Sub