Last active
February 17, 2018 21:22
-
-
Save ateneva/5df3215389701423b2c47cbd73fb8afe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Sub FilterAllTablesInActiveSheet() | |
Dim Wks As Worksheet | |
Dim T As ListObject | |
Dim i As Integer | |
Dim bU As String | |
bU = ActiveSheet.Range("C6").Value | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
For Each Wks In ThisWorkbook.Worksheets | |
If Wks.Visible = True Then Wks.Activate | |
If ActiveSheet.ListObjects.Count > 0 Then | |
For Each T In ActiveSheet.ListObjects | |
If bU = "All" Then | |
T.Range.AutoFilter Field:=1 | |
Else | |
T.Range.AutoFilter Field:=1, Criteria1:=bU | |
End If | |
Next T | |
End If | |
Next Wks | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment