मुख्य सामग्री पर जाएं

 Excel में एकाधिक शीट पर एक ही फ़िल्टर कैसे लागू करें?

लेखक: ज़ियाओयांग अंतिम संशोधित: 2020-05-07

वर्कशीट में डेटा को फ़िल्टर करने के लिए फ़िल्टर फ़ंक्शन को लागू करना हमारे लिए आसान हो सकता है, लेकिन, कभी-कभी, आपको कई वर्कशीट में फ़िल्टर करने की आवश्यकता हो सकती है, जिसमें समान फ़िल्टर मानदंड के साथ सामान्य डेटा फ़ॉर्मेटिंग होती है। उन्हें एक-एक करके फ़िल्टर करने में बहुत समय बर्बाद होगा, यहां, मैं इसे तुरंत हल करने का एक आसान तरीका पेश कर सकता हूं।

VBA कोड के साथ एकाधिक वर्कशीट पर एक ही फ़िल्टर लागू करें


तीर नीला दायां बुलबुला VBA कोड के साथ एकाधिक वर्कशीट पर एक ही फ़िल्टर लागू करें

उदाहरण के लिए, मेरे पास चार वर्कशीट हैं क्योंकि निम्नलिखित स्क्रीनशॉट को उसी मानदंड के साथ फ़िल्टर करने की आवश्यकता है कि उत्पाद = केटीई एक बार में।

दस्तावेज़ एकाधिक शीट फ़िल्टर करें 1

एक्सेल में एकाधिक शीट में डेटा को फ़िल्टर करने का कोई सीधा तरीका नहीं है, लेकिन, निम्नलिखित वीबीए कोड आपको इस काम को पूरा करने में मदद कर सकता है, कृपया निम्नानुसार कार्य करें:

1. दबाए रखें ALT + F11 चाबियाँ, फिर यह खुलता है अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक खिड़की.

2। क्लिक करें सम्मिलित करें > मॉड्यूल, और निम्नलिखित कोड को इसमें पेस्ट करें मॉड्यूल खिड़की।

VBA कोड: एकाधिक कार्यपत्रकों पर एक ही फ़िल्टर लागू करें:

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

3. और फिर दबाएं F5 इस कोड को चलाने की कुंजी, KTE के सभी उत्पादों को एक ही बार में सभी वर्कशीट में फ़िल्टर कर दिया गया है, स्क्रीनशॉट देखें:

दस्तावेज़ एकाधिक शीट फ़िल्टर करें 2

नोट: उपरोक्त कोड के अंदर, इसमें xWs.रेंज("A1").ऑटोफ़िल्टर 1, "=KTE" स्क्रिप्ट, A1 और =केटीई उस कॉलम और मानदंड को इंगित करता है जिसके आधार पर आप फ़िल्टर करना चाहते हैं, नंबर 1 वह कॉलम नंबर है जिसके आधार पर आपने फ़िल्टर किया है, आप उन्हें अपनी आवश्यकता के अनुसार बदल सकते हैं। उदाहरण के लिए, यदि आप 50 से अधिक के ऑर्डर को फ़िल्टर करना चाहते हैं, तो आपको बस इस स्क्रिप्ट को इस प्रकार संशोधित करना होगा: xWs.रेंज("बी1").ऑटोफ़िल्टर 2, ">50".


डेटा को कई मानदंडों या अन्य विशिष्ट स्थितियों के आधार पर फ़िल्टर करें, जैसे पाठ की लंबाई, केस संवेदनशील आदि के आधार पर।

एक्सेल के लिए कुटूलहै सुपर फ़िल्टर सुविधा एक शक्तिशाली उपयोगिता है, आप निम्नलिखित कार्यों को पूरा करने के लिए इस सुविधा को लागू कर सकते हैं:

  • एकाधिक मानदंडों के साथ डेटा फ़िल्टर करें; पाठ की लंबाई के अनुसार डेटा फ़िल्टर करें;
  • अपरकेस/लोअरकेस द्वारा डेटा फ़िल्टर करें; वर्ष/माह/दिन/सप्ताह/तिमाही के अनुसार दिनांक फ़िल्टर करें

दस्तावेज़-सुपर-फ़िल्टर1

एक्सेल के लिए कुटूल: 300 से अधिक उपयोगी एक्सेल ऐड-इन्स के साथ, 30 दिनों में बिना किसी सीमा के आज़माने के लिए निःशुल्क। अभी डाउनलोड करें और निःशुल्क परीक्षण करें!

सर्वोत्तम कार्यालय उत्पादकता उपकरण

🤖 कुटूल्स एआई सहयोगी: निम्न के आधार पर डेटा विश्लेषण में क्रांति लाएं: बुद्धिमान निष्पादन   |  कोड जनरेट करें  |  कस्टम फ़ॉर्मूले बनाएं  |  डेटा का विश्लेषण करें और चार्ट बनाएं  |  कुटूल फ़ंक्शंस का आह्वान करें...
लोकप्रिय सुविधाएँ: डुप्लिकेट ढूंढें, हाइलाइट करें या पहचानें   |  रिक्त पंक्तियाँ हटाएँ   |  डेटा खोए बिना कॉलम या सेल को संयोजित करें   |   फॉर्मूला के बिना गोल ...
सुपर लुकअप: एकाधिक मानदंड VLookup    मल्टीपल वैल्यू वीलुकअप  |   अनेक शीटों में VLookup   |   फजी लुकअप ....
उन्नत ड्रॉप-डाउन सूची: शीघ्रता से ड्रॉप डाउन सूची बनाएं   |  आश्रित ड्रॉप डाउन सूची   |  बहु-चयन ड्रॉप डाउन सूची ....
स्तम्भ प्रबंधक: कॉलमों की एक विशिष्ट संख्या जोड़ें  |  कॉलम ले जाएँ  |  छिपे हुए कॉलम की दृश्यता स्थिति टॉगल करें  |  रेंज और कॉलम की तुलना करें ...
फीचर्ड फीचर्स: ग्रिड फोकस   |  डिजाइन देखें   |   बड़ा फॉर्मूला बार    कार्यपुस्तिका एवं शीट प्रबंधक   |  संसाधन लाइब्रेरी (ऑटो टेक्स्ट)   |  खजूर बीनने वाला   |  कार्यपत्रकों को संयोजित करें   |  एन्क्रिप्ट/डिक्रिप्ट सेल    सूची के अनुसार ईमेल भेजें   |  सुपर फ़िल्टर   |   विशेष फ़िल्टर (फ़िल्टर बोल्ड/इटैलिक/स्ट्राइकथ्रू...) ...
शीर्ष 15 टूलसेट12 टेक्स्ट टूल्स (पाठ जोड़ें, अक्षर हटाएँ, ...)   |   50 + चार्ट प्रकार (गैन्ट चार्ट, ...)   |   40+ प्रैक्टिकल सूत्र (जन्मदिन के आधार पर आयु की गणना करें, ...)   |   19 निवेशन टूल्स (QR कोड डालें, पथ से चित्र सम्मिलित करें, ...)   |   12 रूपांतरण टूल्स (शब्दों को संख्याएँ, मुद्रा रूपांतरण, ...)   |   7 विलय और विभाजन टूल्स (उन्नत संयोजन पंक्तियाँ, विभाजन कोशिकाओं, ...)   |   ... और अधिक

एक्सेल के लिए कुटूल के साथ अपने एक्सेल कौशल को सुपरचार्ज करें, और पहले जैसी दक्षता का अनुभव करें। एक्सेल के लिए कुटूल उत्पादकता बढ़ाने और समय बचाने के लिए 300 से अधिक उन्नत सुविधाएँ प्रदान करता है।  वह सुविधा प्राप्त करने के लिए यहां क्लिक करें जिसकी आपको सबसे अधिक आवश्यकता है...

Description


ऑफिस टैब ऑफिस में टैब्ड इंटरफ़ेस लाता है, और आपके काम को बहुत आसान बनाता है

  • Word, Excel, PowerPoint में टैब्ड संपादन और रीडिंग सक्षम करें, प्रकाशक, एक्सेस, विसियो और प्रोजेक्ट।
  • नई विंडो के बजाय एक ही विंडो के नए टैब में एकाधिक दस्तावेज़ खोलें और बनाएं।
  • आपकी उत्पादकता 50% बढ़ जाती है, और आपके लिए हर दिन सैकड़ों माउस क्लिक कम हो जाते हैं!
Comments (48)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Hello, your code works really well. What about if I want to filter more than one cell value. For example: KTE and KTO? thank you for your help
This comment was minimized by the moderator on the site
Hello, your code works really well. What about if I want to filter more than one cell value. For example: KTE and KTO
This comment was minimized by the moderator on the site
Hi,
i have a work book 20+ sheets, and have to filter each sheet in different column but the same number "0 (Zero)" as in the column "P" in the attached image. along with i have to print preview the sheets which i have mentioned. How to di it sir. Each sheet has link with another or several sheets has linked to specific sheet.
This comment was minimized by the moderator on the site
Works a treat, thank you.
Rated 5 out of 5
This comment was minimized by the moderator on the site
Is it possible to use the code to filter where it does not contain a zero.

I have a workbook with sheets up to 20 sometimes, where one column is always the same in each sheet, want to filter out all zeros.

Hope this makes sense.
This comment was minimized by the moderator on the site
Hello, Richard,
To filter the data exclude the zeros, please apply the below vba code:
Note: in the code, in this xWs.Range("C1").AutoFilter 3, "<>0" script, C1 and <>0 indicates the column and criteria which you want to filter based on, the number 3 is the column number you filtered based on, you can change them to your need.
Sub apply_autofilter_across_worksheets()
'Updateby Extendoffice
    Dim xWs As Worksheet
    On Error Resume Next
    For Each xWs In Worksheets
        xWs.Range("c1").AutoFilter 3, "<>0"
    Next
End Sub


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
I want to use this code to filter on a column across multiple worksheets, the column will always have numbers in it, but I want the auto filter to remove zero values, leaving just minus and plus numbers.

Is this possible?
This comment was minimized by the moderator on the site
I have a spreadsheet with 2 tabs, I want that when I filter one tab, the other respects the filtered items and is also filtered with the same values, how to do that?
This comment was minimized by the moderator on the site
Hello, Fabio,
To solve your problem, you can use the VBA code in this article, and please remeber to change the cell reference and criteria in the code.
Please try again, hope it can help you!
This comment was minimized by the moderator on the site
I am copying and pasting exactly but keep getting "Compile Error: Invalid outside procedure". I have only changed the criteria to match what I need specifically.. below:

Sub apply_autofilter_across_worksheets()
'Updateby Extendoffice
Dim xWs As Worksheet
On Error Resume Next
For Each xWs In Worksheets
xWs.Range("D3").AutoFilter 1, "=Paige"
Next
End Sub
This comment was minimized by the moderator on the site
Hello, Paige,
I have tested your code, and it works well in my workbook.
Could you upload your excel file here, so that we can check where the problem is.
Thank you!
This comment was minimized by the moderator on the site
Amazing work! this macro is great.
This comment was minimized by the moderator on the site
Thank you skyyang Please how do i remove the hidden rows after filtering?
This comment was minimized by the moderator on the site
Hello, Akoma,
To remove all hidden rows after filtering, please apply the below code: (Note: This code will remove all hidden rows in the worksheet, and it will not undo, so you need backup your data.)
Sub DeleteHiddenRows()
Dim sht As Worksheet
Dim LastRow
Set sht = ActiveSheet
LastRow = sht.UsedRange.Rows(sht.UsedRange.Rows.Count).Row
For i = LastRow To 1 Step -1
If Rows(i).Hidden = True Then Rows(i).EntireRow.Delete
Next
End Sub

Please try, hope it can help you!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations