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

³Æ¥÷ÀÉ®×

³Æ¥÷ÀÉ®×

¥­¦w
¥H¤U¥N½X¥i¥H«ö¤é´Á³Æ¥÷ÀÉ®×
¤@­Ó°ÝÃD½Ð±Ð
°²¦p³o­ÓÀɮצ³³\¦hSheet
§Ú¥u·Q¥t¦sSheet(3,5,6,10,11,12,14,15)
¥i¥H°µ¨ì¶Ü ?

Sub Backup ()
PAF = MsgBox("­n³Æ¥÷¸ê®Æ¶Ü?", vbYesNo + vbQuestion, "°T®§µøµ¡")
      If PAF = vbYes Then
      Application.StatusBar = "Àɮ׳ƥ÷¤¤,·q½Ðµy­Ô!"
FileDate = Format(Date, "yyyymmdd")  ' ¦~¤ë¤é®æ¦¡¦@8­Ó¼Æ¦r(³Æ¥÷)
ActiveWorkbook.SaveCopyAs filename:= _
"\\Web_server\pcmac¥æ´«°Ï\µo¦æ\³Æ¥÷\" & FileDate & ".xls"

Else
        MsgBox "¦A¨£ !", vbOKOnly + vbInformation, "°T®§µøµ¡"
        End If
end sub
µL¤îºÉªº§V¤O¤W¶i

¦^´_ 1# vinejason
  1. Option Explicit
  2. Sub Backup()
  3.     Dim FileDate As String
  4.        If MsgBox("­n³Æ¥÷¸ê®Æ¶Ü?", vbYesNo + vbQuestion, "°T®§µøµ¡") = vbYes Then
  5.         Application.StatusBar = "Àɮ׳ƥ÷¤¤,·q½Ðµy­Ô!"
  6.         With ActiveWorkbook.Sheets(Array(3, 5, 6, 10, 11, 12, 14, 15)).Copy
  7.         'With ActiveWorkbook              ¬°§@¥Î¬Oµøµ¡¤¤ªº¬¡­¶Ã¯
  8.         '¥i§ï¦¨ With ThisWorkbook         ¬°µ{¦¡½X©Ò¦bªº¬¡­¶Ã¯
  9.         '¥i§ï¦¨ With Workbooks("TEST.XLS")¬°«ü©wªº¬¡­¶Ã¯
  10.             FileDate = Format(Date, "yyyymmdd")  ' ¦~¤ë¤é®æ¦¡¦@8­Ó¼Æ¦r(³Æ¥÷)
  11.             ActiveWorkbook.Close True, Filename:="\\Web_server\pcmac¥æ´«°Ï\µo¦æ\³Æ¥÷\" & FileDate & ".xls"
  12.             '³o¸ÌªºActiveWorkbook ¤£¥i§ï
  13.             '.Copy«áªº¬¡­¶Ã¯¬°ActiveWorkbook
  14.         End With
  15.     Else
  16.         MsgBox "¦A¨£ !", vbOKOnly + vbInformation, "°T®§µøµ¡"
  17.     End If
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE
Gbkee ¥­¦w
³o¼Ë¤]¥i¥H°µ±o¨ì !
¯u´Î
·PÁ±zªº¦^ÂÐ
¯¬ºÖ±z¤Ñ¤Ñ³Q³ß¼Ö¥]³ò
µL¤îºÉªº§V¤O¤W¶i

TOP

¦^´_ 2# GBKEE
GBKEE ¥­¦w
³Æ¥÷«áªºSheet ¬Û·í§¹¾ã !

¦A½Ð±Ð
¥i¥H§â³Æ¥÷ÀÉ®× Sheet¸Ìªºµ{¦¡½X , ¨ú®ø©Î§R°£¶Ü?
µL¤îºÉªº§V¤O¤W¶i

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-6-20 11:56 ½s¿è

¦^´_ 4# vinejason
  1. Sub Backup()
  2.     Dim FileDate As String
  3.        If MsgBox("­n³Æ¥÷¸ê®Æ¶Ü?", vbYesNo + vbQuestion, "°T®§µøµ¡") = vbYes Then
  4.         Application.StatusBar = "Àɮ׳ƥ÷¤¤,·q½Ðµy­Ô!"
  5.        Application.DisplayAlerts = False
  6.         With ActiveWorkbook.Sheets(Array(3, 5, 6, 10, 11, 12, 14, 15)).Copy
  7.         'With ActiveWorkbook              ¬°§@¥Î¬Oµøµ¡¤¤ªº¬¡­¶Ã¯
  8.         '¥i§ï¦¨ With ThisWorkbook         ¬°µ{¦¡½X©Ò¦bªº¬¡­¶Ã¯
  9.         '¥i§ï¦¨ With Workbooks("TEST.XLS")¬°«ü©wªº¬¡­¶Ã¯
  10.             FileDate = Format(Date, "yyyymmdd")  ' ¦~¤ë¤é®æ¦¡¦@8­Ó¼Æ¦r(³Æ¥÷)
  11.             
  12.             ActiveWorkbook.SaveAs Filename:="\\Web_server\pcmac¥æ´«°Ï\µo¦æ\³Æ¥÷\" & FileDate & ".xls", FileFormat:=xlXMLSpreadsheet
  13.             '**********************************
  14.             '2003ª©:¬¡­¶Ã¯ªºÀɮ׮榡¤Î (©Î) Ãþ«¬¡C  FileFormat:=xlXMLSpreadsheet «ü©w¬° Sheet¸Ì¨S¦³µ{¦¡½XªºÃþ«¬
  15.             '********************************
  16.             
  17.             ActiveWorkbook.Close
  18.             '³o¸ÌªºActiveWorkbook ¤£¥i§ï
  19.             '.Copy«áªº¬¡­¶Ã¯¬°ActiveWorkbook
  20.         End With
  21.     Else
  22.         MsgBox "¦A¨£ !", vbOKOnly + vbInformation, "°T®§µøµ¡"
  23.     End If
  24.    Application.DisplayAlerts = True
  25. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE
GBKEE ¥­¦w
ÁÂÁ±z¥J²Óªº¦^ÂÐ
´¼¼z¤H¤j¦³¯à¤O , ¦³ª¾ÃѪº¤H¤O¤W¥[¤O
µL¤îºÉªº§V¤O¤W¶i

TOP

¦^´_ 5# GBKEE
½Ð±ÐGBKEE
§Ú°Ñ¦Ò±zªº
Sub Backup()
    Dim FileDate As String
    Set wb = ThisWorkbook
    wb.Activate
    If MsgBox("­n³Æ¥÷¸ê®Æ¶Ü?", vbYesNo + vbQuestion, "°T®§µøµ¡") = vbYes Then
         Application.DisplayAlerts = False
        'With ActiveWorkbook.Sheets(Array(1, 3)).Copy     ±N¦¹¦C§ï¦¨¬õ¦â¤@¦C´N¤£³q嘞
        With ActiveWorkbook.copy
            FileDate = Format(Date, "yyyymmdd")
            ActiveWorkbook.SaveAs FileName:=ThisWorkbook.Path & "\¸ê®Æ®w\" & FileDate & ".xls"
            Application.EnableEvents = False
            ActiveWorkbook.Close True
            Application.EnableEvents = True
        End With
    Else
        MsgBox "¦A¨£ !", vbOKOnly + vbInformation, "°T®§µøµ¡"
    End If
    Application.DisplayAlerts = True
End Sub
À³¦p¦ó  §@
¦bwb¤¤¥Îvba
¨Ï­ìwb  copy¦¨  wb1      µM«á wb1.close  (³o¤@¬q§Ú¤£·|¡Atry«Ü¤[嘞)
¦^wb ¦A°µ²Ä¤G

TOP

¦^´_ 7# yangjie
·PÁÂGBKEE  
§Ú°Ñ¦Ò³o¦¸»P«e13.14­¶ªºÀɮ׽ƻs»Psheets¥t¦s·sÀÉ
§Úªº°ÝÃD¸Ñ¨M¤F
Sub Backup()
    Dim FileName1 As String
    Set wb = ThisWorkbook
    wb.Activate
    Dim str1 As String
    Dim ar() As String
    n = Sheets("°ò¥»¸ê®Æ").Cells(1, 60).End(xlToLeft).Column - 5
    If n <= 0 Then Exit Sub
    ReDim ar(n)
    For i = 1 To n
        ar(i - 1) = Sheets("°ò¥»¸ê®Æ").Cells(1, i + 5)
    Next
    str1 = Sheets("°ò¥»¸ê®Æ").Cells(1, 1) & Sheets("°ò¥»¸ê®Æ").Cells(1, 2)
    If MsgBox("­n³Æ¥÷¸ê®Æ¶Ü?", vbYesNo + vbQuestion, "°T®§µøµ¡") = vbYes Then
        Application.DisplayAlerts = False
        For i = 1 To n
            FileName1 = ThisWorkbook.Path & "\" & str1 & "¾Ç´Á(" & ar(i - 1) & ")¥X¯Ê¶Ôº[¼úÃgµn¿ý.xls"
            With ActiveWorkbook
                ActiveWorkbook.SaveCopyAs FileName:=FileName1    'º}«G
            End With
        Next
    Else
        MsgBox "¦A¨£ !", vbOKOnly + vbInformation, "°T®§µøµ¡"
    End If
    Application.DisplayAlerts = True
  End Sub

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD