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

[µo°Ý] ¦p¦ó¯à¤@Áä½Æ»s¨Ã·s¼W¦h­¶¤u§@ªí?

¦^´_ 1# RCRG
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim xDay As Date, i As Date, x As Date
  4.     On Error Resume Next
  5. AG:
  6.     Do
  7.     xDay = InputBox("¿é¤J¤é´Á", "¤u§@ªí¤é´Á", Date)
  8.     If Err > 0 Then Err.Clear: GoTo AG  ' ¤é´Á®æ¦¡¿ù»~:µ{¦¡²¾¨ì AG °õ¦æ
  9.     x = MsgBox("½T©w¤é´Á ¬°: " & Format(xDay, "Dddddd"), vbYesNoCancel, "¤u§@ªí¤é´Á")
  10.     If x = vbCancel Then Exit Sub           '¨ú®øÁä: Â÷¶}³oµ{¦¡
  11.     Loop Until x = vbYes                    '½T©wÁä: Â÷¶}³o°j°é
  12.     On Error GoTo Er
  13.     Application.DisplayAlerts = False
  14.     For i = xDay To xDay + 15 * 2 Step 4    '¶¡¹j4¤Ñ
  15.         For x = i To i + 1                  '³sÄò2¤Ñ
  16.             Sheets("­ì©lÀÉ").Copy after:=Sheets(Sheets.Count)
  17.             ActiveSheet.Name = Format(x, "Dddddd")  '¦³³o¤u§@ªí¤é´Áµ{¦¡©Î¦³¿ù»~
  18.         Next
  19.     Next
  20.     Application.DisplayAlerts = True
  21.     Exit Sub
  22. Er:  '³B¸Ì¤u§@©R¦Wªº¿ù»~
  23.     Sheets(Format(x, "Dddddd")).Delete
  24.     Resume  '¦^¨ì¿ù»~ªºµ{¦¡½X
  25. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¡i°µ¤Hªº¶}©l¡j¨C¤@¤Ñ³£¬O¬G¤Hªº¶}©l¡A¨C¤@­Ó®É¨è³£¬O¦Û¤vªºÄµ±§¡C
ªð¦^¦Cªí ¤W¤@¥DÃD