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

[µo°Ý] ³Æ¥÷¤å¥ó¥¨¶°°ÝÃD

[µo°Ý] ³Æ¥÷¤å¥ó¥¨¶°°ÝÃD

¥»©«³Ì«á¥Ñ mycmyc ©ó 2010-10-19 22:33 ½s¿è

½Ð°Ý §Ú¼Ò¥é¥L¤H °µ¤@­Ó ³Æ¥÷¥¨¶°

Sub backup_file()
'§âÀɮק@§¹¾ãªº³Æ¥÷¦b¥t¥~ªº¸ô®|

TmpN1 = Format(Date, "yyyymmdd") '¥Î¤µ¤Ñªº¤é´Á·í§@¥t¦s·sÀɪºÀɦW
TmpN2 = Format(Time, "s") '¥Î·í®Éªº¬í¼Æ·í¨úÀɦWªº±ø¥ó
ActiveWorkbook.SaveAs Filename:="C:\" & TmpN1 & "_" & TmpN2 & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False

'³Æ¥÷Àɮתº¸ô®|¤ÎÀɦW
ActiveWorkbook.SaveAs Filename:="E:\macro-test\test2\" & TmpN1 & "_" & TmpN2 & "B" & ".xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= _
False, CreateBackup:=False

Workbooks.Open "C:\" & TmpN1 & "_" & TmpN2 & ".xls"
Workbooks(TmpN1 & "_" & TmpN2 & "B" & ".xls").Close SaveChanges:=False

End Sub
¤]°µ¤@­Ó«öÁä  §Ú·Q«ö«á ¯à¥X²{¤@­Ó«H®§"§A½T©w­n¦sÀÉ¶Ü " ¦³ "¬O"  "§_"  
³o³Æ¥÷ÀÉ «Ü©Ç ¥L·|Àx¦s¨ì³Æ¥÷ÀÉ ¦ý¥ÀÀÉ «o¨SÀx¦s¨ì «K¸õ¨ì ³Æ¥÷ÀÉ  
¯àÀ°§Ú­×¥¿ ¥ÀÀɤ]Àx¦s ¨Ã³Æ¥÷  ¨Ãºû«ù¥ÀÀɶ}±Òª¬ºA ¶Ü
³Æ¥÷.rar (13.85 KB)

ActiveWorkbook.Save  ¸Ñ¨M Àx¦s¥ÀÀÉ°ÝÃD
HI

¦^´_ 1# mycmyc
VBA°ÝÃD  ½Ð¨ìµ{¦¡°Ï
  1. Sub Ex()
  2.     Dim FS As Object, Tmpn1, Tmpn2
  3.     If MsgBox("§A½T©w­n¦sÀÉ¶Ü ?", vbYesNo + vbInformation) = vbYes Then
  4.         Set FS = CreateObject("Scripting.FileSystemObject")
  5.         Tmpn1 = "C:\" & Format(Now, "yyyymmdd_s ") & ".xls" '¥Î¤µ¤Ñªº¤é´Á·í§@¥t¦s·sÀɪºÀɦW
  6.         Tmpn2 = "E:\macro-test\test2\" & Format(Now, "yyyymmdd_s ") & "B.xls" '¥Î¤µ¤Ñªº¤é´Á·í§@¥t¦s·sÀɪºÀɦW
  7.         ActiveWorkbook.Save
  8.         FS.CopyFile ActiveWorkbook.FullName, Tmpn1
  9.         FS.CopyFile ActiveWorkbook.FullName, Tmpn2
  10.     End If
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# GBKEE
  ÁÂÁ °T®§ ¤w¸g¸Ñ¨M
  ¦ý ActiveWorkbook.Save  Àx¦s³£¨S¦³°ÝÃD¡A¦ý¬O¨C¦¸³£·|¦Û°Ê¶}±ÒExcel ÀÉ®×
     ¦³¨S¦³§OªºÀx¦s¤è¦¡¥i¥H¦Û°Ê¦sÀɤ£·|¶}±Ò Excel ÀÉ®×!!!
      ´N¬O­n¯d¦b¥DÀÉ(¥ÀÀÉ)
HI

TOP

¦^´_ 3# mycmyc
¨C¦¸³£·|¦Û°Ê¶}±ÒExcel ÀÉ®×   ¬O§¹¥þ¨Ì¾Ú§Úªºµ{¦¡¶Ü? ¤£·|°Ú!
ªþ¤Wµ{¦¡½X¨Ó¬Ý¬Ý?

TOP

¦^´_ 4# GBKEE

¹ï¤£°_ ­è­è¦b­×¥¿«á ¦p§Aµ{¦¡ok
½Ð°Ý§A ¥Î¨º­Ó±±¨î ¦sÀÉ«á  ÁÙ¯à¦b¥DÀɤW
FS.CopyFile ActiveWorkbook.FullName, Tmpn2
³o¦æ¶Ü?
HI

TOP

¦^´_ 5# mycmyc
¹ïªº
     ActiveWorkbook.Save   '¥ÀÀɻݥý°µ¦sÀɪº°Ê§@   
     FS.CopyFile ActiveWorkbook.FullName, Tmpn1
     FS.CopyFile ActiveWorkbook.FullName, Tmpn2

TOP

¦^´_ 6# GBKEE
   ÁÂÁ§A  ¤F¸Ñ
HI

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD