- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 16
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-14
|
¤j®a¦n¡A§Ú²Ä¤@¦¸µo©«¡A¦pªG¦³¤°»ò¤£¹ïªº½Ð¨£½Ì
¦]¬°¨C¤ë³£n¤W¥æ¤ëµ²³øªí¡A¤£·Q¦A°Å°Å¶K¶K¡A©Ò¥H¦b¹Á¸Õ¥Î ...
lovenice831 µoªí©ó 2020-12-11 15:23
§Ú§â Module2 §R±¼,
¨Ã§â©Ò¦³ªºµ{¦¡³£¶°¤¤¦bModule1¤F :- Public iI% ' ¾ãÓÀɮפº³£¥i¦@¥ÎªºÅܼƩΪ«¥ó¨Ï¥ÎPublic«Å§i©ó¦¹,
- Public lRows&
- Public wsTar As Worksheet, wsSou(1 To 2) As Worksheet ' «½Æ©Ê§@·~§Q¥Îª«¥ó°}¦C»P°j°é§¹¦¨
- Sub Auto_Open() ' ¶}±Ò¬¡¶Ã¯®É·|¦Û°Ê°õ¦æ, ¥i©ñ¸m·|¦@¥Î»Ý¥ýªì©l¤Æªº«ü¥O
- Set wsTar = Worksheets("¤ëµ²") ' ³]©w¤u§@ªíª«¥óÅܼÆ
- Set wsSou(1) = Worksheets("¤u§@ªí1")
- Set wsSou(2) = Worksheets("¤u§@ªí2")
- End Sub
- Sub ¤ëµ²_Click()
- With wsTar
- lRows = .Cells(Rows.Count, 1).End(xlUp).Row ' ±q¤U©¹¤W§ä¨ì³Ì©³¤U¤@¦Cªº¦C¸¹
- If lRows < 3 Then lRows = 3 ' ³Ì¤p¬°3, ÁקK§R±¼¼ÐÃD
- .Range(.[A3], .Cells(lRows, 3)).Clear ' ²M°£¤W¦¸²£¥Íªº¸ê®Æ, ¥H«K²£¥Í·s¸ê®Æ
- End With
-
- For iI = 1 To 2 ' ¹ï¨âÓ¤u§@ªí³vÓ¨ú¥X»Ýnªº¸ê®Æ°µ³B²z
- With wsSou(iI)
- .Select ' ©³¤U§@¥ÎÀx¦s®æ²¾¨ìAÄæ³Ì·s¸ê®Æ¦C«e,»Ý¥ý±N¤u§@ªíSelect
- .[A3].AutoFilter Field:=2, Criteria1:="¥xÆW"
- .Range(.[A3], .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 3)).Copy wsTar.Cells(Rows.Count, 1).End(xlUp).Offset(1)
- ' «þ¨©»Ýnªº¸ê®Æ, ¶K¨ì¤ëµ²¤u§@ªíªº¸ê®Æ³Ì·s¦C
- .[A3].AutoFilter Field:=2
- .Cells(.Cells(Rows.Count, 1).End(xlUp).Row, 1).Offset(1).Select ' §@¥ÎÀx¦s®æ²¾¨ìAÄæ³Ì·s¸ê®Æ¦C-AÄæ±q¤U©¹¤Wºâ³Ì©³¤U¤@¦Cªº¤U¤è¨º®æ
- End With
- Next
- wsTar.Select ' Åã¥Ü¤ëµ²¤u§@ªí
- End Sub
- Sub test_()
- Dim Vsha
- Dim wsNew As Worksheet, wsTemp As Worksheet
-
- With Workbooks.Add
- Set wsTemp = .ActiveSheet
- wsTar.Copy before:=.Worksheets(1)
- Set wsNew = .ActiveSheet
- wsTemp.Delete
- Set wsTemp = Nothing
- With wsNew
- .name = .[11]
- For Each Vsha In .Shapes
- Vsha.Delete
- Next
- .Parent.SaveAs ThisWorkbook.Path & Application.PathSeparator & .name
- End With
- .Close False
- End With
- End Sub
½Æ»s¥N½X
test save&clear-a.zip (22.04 KB)
|
|