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

[µo°Ý] VBA ²¾°ÊÀx¦s®æ¦ì¸m¡A¥t¦s·sÀɤΧR°£

¦^´_  ­ã´£³¡ªL
ÁÂÁÂÀ°¦£¡A¦ý§Ú¤£ª¾¥X²{¤°»ò°ÝÃD¡A¸ÕµÛ¸ÕµÛ¡A²{¦b¥þ³£¥Î¤£¨ì¡A³Â·ÐÀ°¦£¬d¬Ý¤@¤U¡AÁÂÁÂ
...
lovenice831 µoªí©ó 2020-12-26 20:13

Monthlyµ{¦¡.jpg

.[c8].AutoFilter Field:=1, Criteria1:=xS.[j2]

¸Õ¸Õ¬Ý...

TOP

¦^´_ 11# luhpro


    ¥ýÁ¹L¡A§Ú¸ÕÂà1 ¡A¦ýÂà¤@«á¥u¯àÅã¥ÜA ªºµ²ªG¡AB ©MC ªº³£¨ÌµM¬OªÅ¥Õ

TOP

¦^´_ 10# ­ã´£³¡ªL

¤£¦n·N«ä¡A§ÚÂà¾×¤F¨Ã¦A¤W¶Ç¡A³Â·Ð¤F  
test Inventory.rar (237 KB)

TOP

¦^´_ 13# lovenice831


¤@¼Ë¥´¤£¶},
WITH SHEETS(1)
À³¸Ó¬O
WITH SHEETS(i)

TOP

¦^´_ 14# ­ã´£³¡ªL
¦nªº¡A§Ú¦A¸Õ¤@¤U¡A¤£¦n·N«ä¡A³Â·Ð§A¤F

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2020-12-28 21:43 ½s¿è
¦^´_  ­ã´£³¡ªL

¤£¦n·N«ä¡A§ÚÂà¾×¤F¨Ã¦A¤W¶Ç¡A³Â·Ð¤F
lovenice831 µoªí©ó 2020-12-28 10:49

§Úı±o§Aªºµ{¦¡°ÝÃDÀ³¸Ó¤£¦b¨º¸Ì³á.

¥H¤U¬Oµ{¦¡¤º®e:
  1. Sub Monthly()
  2. Dim xS As Worksheet, T$, i&, xE As Range
  3. Call clean
  4. Set xS = Sheets("Monthly")
  5. If xS.[j2] = "" Then MsgBox "please choose!  ": Exit Sub
  6. For i = 1 To 3
  7.     With Sheets(1)
  8.          If .FilterMode Then .ShowAllData
  9.          .[c8].AutoFilter Field:=1, Criteria1:=xS.[j2]
  10.           Set xE = xS.Cells(Rows.Count, 1).End(xlUp)(5)
  11.          .AutoFilter.Range.Offset(1, 2).Resize(, 30).Copy xE
  12.          .ShowAllData
  13.          End With
  14. Next i
  15. End Sub
½Æ»s¥N½X
§Ú·Q°ÝÃDÀ³¸Ó¦b©ó :
.[c8].AutoFilter Field:=1, Criteria1:=xS.[j2] «á­±ªº Criteria1:=xS.[j2],
§Aªº¿z¿ïÁä­È³£¬O¬Û¦Pªº(¦]¬°xSªº[j2]ªº­È¤£·|ÅÜ,¦bµ{¦¡¤¤³o®æ¤l¤ºªº­È¥²¶·¥ÑUser¤â°Ê°µÅܧó)
·íªì´N¤£¤Ó¤F¸Ñ§A3­Ó°j°é«ç»ò³£¬O§ì¬Û¦Pªº¸ê®Æ?

²{¦b¨Ì§Aªº±Ô­z,
§Ú·Q§A§ï¦¨³o¼Ë¸Õ¸Õ:
Dim xS As Worksheet, T$, i&, xE As Range, vPro()
vPro = Array("A", "B", "C")

......
For i =  0 To 2
......
.[c8].AutoFilter Field:=1, Criteria1:=vPro(i)

TOP

¦^´_ 16# luhpro


    ÁÂÁ§Aªº¸Ñµª¡A¾ãÅé¨Ó»¡§Ú¤§©Ò¥H­n¤T­Ó°j°é¬O¦]¬°¤@­Ó¤À­¶µ¥©ó¤@±ø¥Í²£½u¡A¨C¤ë§À³£»Ý­n§â¦UµP¤lªº³fª«¤À§O°µ¦¨¤ëµ²ªí¡A©Ò¥H»Ý­n³o¼Ë°j°é¡AÁÂÁÂÀ°¦£

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD