• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Filter values in mutiple tabs

Ajith S

New Member
Hi,

I am not great with macros.

Please refer to below code

Code:
Sub apply_autofilter_across_worksheets()

  Dim xWs As Worksheet
  On Error Resume Next
  For Each xWs In Worksheets
  xWs.Range("A1").AutoFilter 1, "=KTE"
  Next
End Sub

Can you help me to edit this code.

I don't have a criteria, but I want to filter based in cell value in B9.

Thanks in advance for your time.
 
Last edited by a moderator:
Ajith S
Only You could know
... What are You looking for.
Ideas...
Your range is ... small? I would be a challenge.
Is that criteria same or do this would use unique per sheet?
You could use criteria eg like below.
Code:
Sub Testing()
    On Error Resume Next
    For Each ws In Worksheets
        ws.Range("A:A").AutoFilter Field:=1, Criteria1:=ws.Range("B9")
    Next
End Sub
 
Hi,
I found this code and modified it.
See if it works for you.
Code:
Sub filter_across_worksheets()
    Dim xWs As Worksheet
    On Error Resume Next
    For Each xWs In Worksheets
        xWs.Range("A9:b9").AutoFilter Field:=1, Criteria1:="KTE"
    Next
End Sub
Charles

Oop's did see vietm reply.
 
Back
Top