- ©«¤l
- 406
- ¥DÃD
- 8
- ºëµØ
- 0
- ¿n¤À
- 453
- ÂI¦W
- 0
- §@·~¨t²Î
- WINDOWS 7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2015-2-7
- ³Ì«áµn¿ý
- 2021-7-31
|
¥»©«³Ì«á¥Ñ n7822123 ©ó 2020-7-27 00:58 ½s¿è
¦^´_ 3# papaya
¥ýÀ°§A§âAÄ檺®æ¦¡§ï¦¨¤é´Á®æ¦¡¡A§Ú¦Û»{µù¸Ñ¼g¤£¤Ö....¥B¨¾§b¼g¤£¤Ö
©Ò¥Hµ{¦¡¼gªº¤ñ¸ûªø¤@ÂI¡A§Æ±æ¬ÝªºÀ´§a~ µ{¦¡¦p¤U
Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim Arr, ¦¹ªí As Worksheet, ¤é´Á As Date, tim!, rg As Range, Rn&, xlsNm$, sh
Arr = Array("¤C¬F", "¤K¨ö", "¤¦æ", "¤»¨R", "¥Í¨v", "¦X¼Æ", "§¡È", "§À¼Æ")
Set ¦¹ªí = ActiveSheet
'1_¥ý³]¥ß1Ó¥i¿é¤J¤é´Á(yyyymmdd)ªºInputBox
¤é´Á = InputBox("½Ð¿é¤J¤é´Á¡A®æ¦¡Ex:2020/07/07", "¿é¤J¤é´Á")
If IsEmpty(¤é´Á) Then Exit Sub
'ÀɮצWºÙ="¤j¼Ö³z_¿òº|ªÅÁ`²Îpªí_¿é¤JInputBoxªº¤é´Á¡¨
xlsNm = "¤j¼Ö³z_¿òº|ªÅÁ`²Îpªí_" & Format(¤é´Á, "mmdd")
'Àˬd¬O§_¤w¦³ÀÉ®×(ÁקK«Âаõ¦æ)
Àˬd$ = Dir(ThisWorkbook.Path & "\" & xlsNm & ".xls*")
If Àˬd <> "" Then
re% = MsgBox("¦¹Àɮפw¦s¦b¡A½Ð½T»{¬O§_Âл\?", vbYesNo)
If re = vbNo Then Exit Sub Else Kill ThisWorkbook.Path & "\" & Àˬd
End If
tim = Timer '¶}©lp®É
'¤ñ¹ï¤é´Á
For Each rg In Range([A1], [A1].End(4))
If rg = ¤é´Á Then Rn = rg.Row: Exit For
Next
'¦pªG¸ÓB¡JH="¡¨®É¡A«hArrªºA1¤]="¡¨
If Rn = 0 Then MsgBox "§ä¤£¨ì¤é´Á": Exit Sub
For Each sh In Arr
With Sheets(sh): ¦¹ªí.Activate
'2_¸Ó¤é´Á¶ñ¤J"¤C¬F","¤K¨ö","¤¦æ","¤»¨R","¦X¼Æ","¥Í¨v","§¡È","§À¼Æ"ªº¦U¤u§@ªí
.[A1] = Format(¤é´Á, "yyyy/mm/dd")
'¨Ã±NDATAªºAÄæ=X¤é´Áªº¤U1¦C¤§B¡JH¼Æȶñ¤J
.[A3].Resize(7) = Application.Transpose(Cells(Rn + 1, 2).Resize(, 7))
End With
Next
'3_±N§¹¦¨²Ä2¶µªº"Arr"¿é¥X¬°1Ó¿W¥ßÀÉ®×
With Workbooks.Add
For i = 0 To UBound(Arr)
ThisWorkbook.Sheets(Arr(i)).Copy After:=.Sheets(.Sheets.Count)
Next
.Sheets(Array(1, 2, 3)).Delete
.SaveAs ThisWorkbook.Path & "\" & xlsNm '¨Sµ¹°ÆÀɦW¡AªO·sª©Excel³£¾A¥Î
.Close True
End With
[Q2] = Round(Timer - tim, 2)
End Sub
Àɮצp¤U
49¤j¼Ö³z(¥DÀÉ).rar (22.26 KB)
§A¥t¤@©«»Ý¨D·Pı§ó¦h¡A¥ú¬Ý°_¨Ó´N·Pı¦³ÂI³Â·Ð.....
¬Ý¦³¨S¦³¤HÄ@·NÀ°§A¡A¤µ¤Ñ¥ý³o¼Ë |
|