ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] autofilter¥\¯à½Ð±Ð

[µo°Ý] autofilter¥\¯à½Ð±Ð

§Ú·Q­n¶}±ÒexcelÀɮתº®É­Ô¡A±NÀɮפºªºautofiler¥\¯à¦Û°Ê¨ú®ø
´ú¸Õ¤Fµ{¦¡
Dim ws As Worksheet
    For Each ws In Worksheets
        If ws.AutoFilterMode Then
            ws.AutoFilterMode = False
        End If
Next ws
¤£ºÞ¬O³]¸m¦b¨ºªºautofiler³£¯à¨ú®ø
¦ý¬O±N¤W­z¸ê®Æ°Ï°ì±qrangeÅܦ¨Table«á´NµLªk¦Û°Ê¨ú®øautofiler
©Ò¥H­«·s¼g¤F¤@­Ó
Private Sub Workbook_Open()

Dim ws As Worksheet
Dim tbl As ListObject
   
   
    For Each ws In ThisWorkbook.Worksheets
      
        On Error Resume Next
        Set tbl = ws.ListObjects("Table1")
        On Error GoTo 0
        
      
        If Not tbl Is Nothing Then
            If tbl.AutoFilter.FilterMode Then
                ' Turn off autofilter
                tbl.AutoFilter.ShowAllData
            End If
        End If
        

        Set tbl = Nothing
    Next ws
End Sub
¨Ì¨S¿ìªk±Nªí®æ¤ºªºautofilter¨ú®ø

½Ð±Ð¬O­þ¸Ì¥X¿ù¤F©O?

Book1111.zip (21.93 KB)

autofilter¥\¯à

²öÅý¥L¤H¿ù»~¶Ë®`¦Û¤v

§A¦n¡A¤p§Ì¤£§÷¡A¸Õ¤F¤@¤U¡A
1. ·PıÀ³¸Ó¬O§Aªº¿z¿ï¤£¬O¦b²Ä¤@¦æ¡A©Ò¥H¤£¯à¥Î³o¤è¦¡¡A»Ý­n¥ý¿ï ©Ò¦b¦æªº  cell¡AµM«áÁÙ¤£¯à«ü©w¬O¶}ÁÙ¬OÃö¡A¥u¯à¤@¦¸¶}¤@¦¸Ãö¡A¦p¹Ï¤@
2. ¦pªG§Aªº«ö¶s­n¦@¥Î¡A¤£¯à¥Î command bottom (active X ¥u¯à§@¥Î¦b¸Ó¤À­¶)¡A­n¥Îªí³æ±±¨î¶µ(Åܦ¨ module)¡A¦p¹Ï¤G

Dim ws As Worksheet
For Each ws In Application.Worksheets
    ws1 = ws.Name
    'MsgBox (ws1)
    Worksheets(ws1).Activate
    Cells(3, 1).Select
    Selection.AutoFilter
    'Selection.AutoFilterMode = False µLªk¨Ï¥Î
    'AutoFilterMode = False µLªk¨Ï¥Î
Next ws

001.png (31.69 KB)

001.png

002.png (62.24 KB)

002.png

TOP

¦^´_ 2# xyz66217

¤j¤j±z¦n
§Ú¬O­n¦b¶}±Òexcelªº®É­Ô¡A´NÅýµ{¦¡¥h°õ¦æ¡AÀˬd¬Ý¬Ý¦³¨S¦³autofilter
¦pªG¤@¯ëªº range®æ¦¡ªºªí®æ¡A³£¨S°ÝÃD
¦ý­Y¬O§ârangeÅܦ¨"ªí®æ"¡A´N¨S¿ìªk¤F

­è´ú¸Õ¤F±zªº¤è¦¡¡A¦b"ªí®æ"ªºª¬ºA¤U
¤£½×¬O¦b­þ¤@¦C³£¤£¯à
²öÅý¥L¤H¿ù»~¶Ë®`¦Û¤v

TOP

hello¡Aµ{¦¡§ï¦b¹Ï¤@¦ì¸m´N¥i¥H¤FÅo¡C

001.png (198.48 KB)

001.png

Book1111.zip (34.03 KB)

TOP

hello¡Aµ{¦¡§ï¦b¹Ï¤@¦ì¸m´N¥i¥H¤FÅo¡C
xyz66217 µoªí©ó 2024-8-19 17:28



  §Ñ¤F»¡¡A´N¹³§Ú»¡ªº¥i¯à¤£¬O¦b²Ä¤@¦æ¡A©Ò¥H¤£¯à¿ï¾Ü¥´¶}©ÎÃö³¬¡A¥u¯à¤@¦¸¥´¶}¤@¦¸Ãö³¬¡A½ü¬y¦bÀÉ®×¥´¶}®É¦Û°Ê°õ¦æ

TOP

        ÀR«ä¦Û¦b : «Î¼e¤£¦p¤ß¼e¡C
ªð¦^¦Cªí ¤W¤@¥DÃD