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

[µo°Ý] excel VBA ¦Û°Ê§ó·s¿z¿ï°ÝÃD

¦^´_ 4# n7822123
Dear n7822123,
¦­¦w±z¦n¡A·PÁ±zªº¦^ÂСAª¾¹DÅo¡I
Thank you.
Just do it.

TOP

¦^´_ 5# Andy2483
Dear Andy2483,
¦­¦w¡I·PÁ±zªº¦^ÂСI
¸Õ¹L«á¥i¥H¨Ï¥Î¡A·P®¦¡I
¥i§_±Ð§Ú¤@¤UVBA»yªk¤j·§¤º®e¬O«ç»ò°µªº©O¡H
ÁÂÁ§A¡I¡I¡I
Just do it.

TOP

¦^´_ 3# jsc0518


2­Ó¥H¤U¿z¿ï¨ú®ø¶µ¦³®Ä
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
   Dim Qx$, Af&, Sc$, i&
   Af = 32
   Sc = ""
   Qx = ""
   If .Column = Af And .Row >= 2 And .Count = 1 Then
      If ActiveSheet.FilterMode = True Then
         For i = 2 To ActiveSheet.UsedRange.Rows.Count
            If Rows(i).EntireRow.Hidden = True Then
               If Sc = "" Then
                  Sc = Cells(i, "AF")
               End If
               If Qx = "" And Cells(i, "AF") <> Sc Then
                  Qx = Cells(i, "AF")
               End If
               If InStr(Sc & "," & Qx, Cells(i, "AF")) = 0 Then
                  GoTo 99
               End If
            End If
         Next
         Selection.AutoFilter Field:=Af, Criteria1:="<>" & Sc, Operator:=xlAnd, Criteria2:="<>" & Qx
         ActiveSheet.AutoFilter.ApplyFilter
         
99
      End If
   End If
End With
End Sub

°Ñ¦Ò!
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

¥»©«³Ì«á¥Ñ n7822123 ©ó 2021-7-22 00:01 ½s¿è

¦^´_ 3# jsc0518

§Ú¬O·Q»¡¡A¦³¬Æ»ò¤è¦¡¬O¥i¥HÅýVBA¥u»{©w§Ú²Ä¤@¦¸¨ú®øªº¿ï¶µ¡A¦Ó¨ä¥L¿ï¶µ¥X¨Ó®É¡A¬OµL§@°Êªº

¿z¿ï±ø¥ó¤£·|¥h°O¿ý §A "¨ú®ø" ªº¡A¥u·|°O¿ý"²{¦³" ªº

¦pªG§A­ì¥»¦³ A¡BB¡BC ¡A3­Ó±ø¥ó¡A§A§âC¨ú®ø¤F¡AExcelªº¿z¿ï±ø¥ó·|¬ö¿ý¦¨ "­nA¡B¤]­nB"¡A¦Ó¤£¬O "¤£­nC"

¸ê®Æ¿z¿ïªº¥»·N=±q²{¦³ªº¸ê®Æ¥h¹LÂo

¦pªG¸ê®Æ¥u¦³A¡BB¡BC¡A´Nºâ¥ÎVBA¼g¿z¿ï±ø¥ó¡A¦h¤@­ÓD±ø¥ó¡AExcel¤]¬O¤£»{±bªº

©Ò¥H·í¸ê®Æ¦³ÅܰʮɡA¥u¯à¥ÎVBA "­«¼g±ø¥ó"

µ{¦¡¬O¨Ì»Ý¨D¼gªº¡A»Ý¨Dªí¹F¤£²M·¡
©ÎªÌ¨S¦³¤W¶Çªþ¥ó¡A·R²ö¯à§U

TOP

¦^´_ 2# Andy2483
Dear Andy2483,
©êºp§Úªí¹Fªº¤£²M·¡¡A

1.¦bAFÄæ¦ì¦³³]©w"¸ê®ÆÅçÃÒ(¤U©Ô¦¡¿ï³æ)¡G«Ý®Æ,«Ý¥Í²£,¥Í²£¤¤,¾÷¥x²§±`,µ²§å,¼È°±"³o6­Ó¿ï¶µ
2.¦bAFÄæ¦ì¤U¥u¦³"«Ý®Æ,«Ý¥Í²£,¥Í²£¤¤,µ²§å"³o¨Ç¸ê°T
3.§Ú¦bAFÄæ¦ì¥Î¿z¿ïªº¤è¦¡¡A¥ý§â"µ²§å"³o¨ú®ø¤Ä¿ï±¼¡C
4.¦¹®É"µ²§å"Äæ¦ì·|³Q¦Û°ÊÁôÂñ¼¡C
5.³o®É§Ú¦bAFÄæ¦ì¤¤¡A­YÂI¿ï¤U©Ô¦¡¿ï³æ¿ï¾Ü"¾÷¥x²§±`"©Î"¼È°±"®É¡AVBA¤@¼Ë·|§â¥¦­Ìµ¹¤©¦Û°ÊÁôÂÃ

§Ú¿ý¤F¤@¬q¹Lµ{¡A·í§Ú¿ï¾Ü"«Ý®Æ"VBA¤@¼Ë·|§â¥¦­Ìµ¹¤©¦Û°ÊÁôÂÃ
111111111111111111111111.gif

§Úµo²{¤j·§¬O¦]¬°·í§Ú¦b°µ-->AFÄæ¦ì¥Î¿z¿ïªº¤è¦¡¡A¥ý§â"µ²§å"³o¨ú®ø¤Ä¿ï±¼®É¡C
¦¹®ÉAFÄæ¦ì¤U¥u¦³"¥Í²£¤¤,«Ý¥Í²£,¼È°±"³o3­Ó¿ï¶µ¡A

©Ò¥H·í§Ú¦bAF¿ï¾Ü°£¤F"¥Í²£¤¤,«Ý¥Í²£,¼È°±"³o3­Ó¿ï¶µ¥~ªº¸ê°T¡A°ò¥»¤W³£·|³QVBA¦Û°ÊÁôÂÃ

§Ú¬O·Q»¡¡A¦³¬Æ»ò¤è¦¡¬O¥i¥HÅýVBA¥u»{©w§Ú²Ä¤@¦¸¨ú®øªº¿ï¶µ¡A¦Ó¨ä¥L¿ï¶µ¥X¨Ó®É¡A¬OµL§@°Êªº
Just do it.

TOP

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
   If .Column = 32 And .Row >= 2 And .Count = 1 Then
      If ActiveSheet.FilterMode = True Then
         If .Value <> "¾÷¥x²§±`" Then
            .Rows(.Count).EntireRow.Hidden = True
         End If
      End If
   End If
End With
End Sub

°Ñ¦Ò!
¥Î¦æ°Ê¸Ë¸mÂsÄý½×¾Â¾Ç²ß«Ü¤è«K,ÁÂÁ½׾¸gÀç¹Î¶¤
½Ð¤j®a¤@°_¤W½×¾Â¨Ó¥æ¬y

TOP

        ÀR«ä¦Û¦b : ¡i»X½ªªº¦Û¥Ñ¡j¤H±`¦b¤°»ò³£¥i¥H¦Û¥Ñ¦Û¦bªº®É­Ô¡A«o³Q³oºØÀH¤ß©Ò±ýªº¦Û¥Ñ»X½ª¡AµêÂY®É¥ú¦Ó²@µLıª¾¡C
ªð¦^¦Cªí ¤W¤@¥DÃD