- ©«¤l
- 913
- ¥DÃD
- 150
- ºëµØ
- 0
- ¿n¤À
- 1089
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- office 2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2011-8-28
- ³Ì«áµn¿ý
- 2023-7-19
|
[µo°Ý] µ{¦¡µLªk²M°£¸ê®Æ,¦Ó¥B°õ¦æ³t«×«ÜºC
½Ð°Ý¤GÓ°ÝÃD:
¤â°ÊLabel.rar (270.11 KB)
1. ³o¬qµ{¦¡¬O¥ý±NSheets("Label (3)")ªºJ2~J endªº¸ê®Æ²M°£¡A¦ý³oÓ«o¼gªkµLªk²M°£¸ê®Æ.- Set Wb = Workbooks("³Ì·s®w¦s.xlsx")
- Set S = Wb.Sheets("Label (3)")
- S.Select
- With S
- Set A = .Range("J2", .Range("J2").End(xlDown)) '±q«ü©wÂI¨ì¸ê®Æ³Ì©³³¡....¦ý³oÓ¼gªk¤£¯à¦Û°Ê²M°£
- A.ClearContents '²M°£¸ê®Æ
- End With
½Æ»s¥N½X 2. Sheets("Label (3)")¤w¤â°Ê§â»Ýn¥´¤Äªº³¡¥÷¤â°Ê¸É¤W¡A쥻ªºªº¸ê®Æ¦³¦n´X¤d¦C¡A³oÓ¼gªk¦b°õ¦æ®É·|°±¹y«Ü¤[¡A¹³µ{¦¡§Ö·í±¼ªº·Pı¡A½Ð°Ý¬O§_¦³¤£¦P¼gªk¡A¥i¥HÅý¥¦°õ¦æ§Ö¤@ÂI¡H
³oÓµ{¦¡ªº°õ¦æ¹Lµ{¬OÅýJÄ楴¤Äªº³¡¥÷¡A¥þ³¡·s¼W¤G¦C¡AµM«á±N쥻¥´¤Äªº¦P¦CCÄæ¸ê®Æ,½Æ¨î¶K¤W¨ì·s¼W¦CªºBÄ椤¡A¦pªGµLªk©ú¥Õ§Úªº¸Ñ»¡¡A½Ð±Nªþ¥óªºÀÉ®×°õ¦æ¬Ý¬Ý¡A¥i¯à¤ñ¸û®e©öÀ´¡A¤£¹L¦]¬°¸ê®Æ¤w¸g´î¤Ö¤F¡A¥i¯à¤ñ¸û¤£·Pı"¥d¥d"ªº¡A¤£¹L¯u¹ê±¡ªp¬O¶]±o«Ü¤£²z·Q.- Set Wb = Workbooks("³Ì·s®w¦s.xlsx")
- Wb.Activate
-
- Set S = Wb.Sheets("Label (3)")
- With S
- .UsedRange.AutoFilter Field:=10, Criteria1:="", Operator:=xlAnd 'ªÅ®æªº¸ê®Æ§R°£
- Set xRng = .UsedRange.Offset(1, 0).SpecialCells(xlCellTypeVisible) '¿ï¾Ü¦³¸ê®Æªº½d³ò§R°£,Offset(1, 0)ªí¥ÜªíÀY©¹¤U¤@¦C¶}©l
- xRng.Delete
- .UsedRange.AutoFilter Field:=10 '¨ú®ø¿z¿ï
- End With
- With S
- LastRow = ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row
- For J = 1 To LastRow
- If Range("J" & J).Value = "V" Then
- LastRow = LastRow + 2
- End If
- Next J
-
- For J = 1 To LastRow
- If Range("J" & J).Value = "V" Then 'JÄæ"V",«h·s¼W2¦C
- Rows(J + 1).Insert Shift:=xlDown
- Rows(J + 1).Insert Shift:=xlDown
- Range("C" & J).Copy
- Range("B" & J + 1).Select '"V"¦P¦CªºCÄæÈcopy¨ì·s¼W²Ä1¦CªºBÄæ
- ActiveSheet.Paste
- End If
- Next J
- End With
-
- ActiveWorkbook.SaveAs "D:\5_VBA¿é¥X³øªí\®w¦s_" & Format(Date, "YYYYMMDD") & "." & Format(Time, "HHMM") & ".xlsx"
- Kill "D:\Download\¼È¦s\³Ì·s®w¦s.xlsx"
- End Sub
½Æ»s¥N½X |
|