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

worksheets copy °ÝÃD

worksheets copy °ÝÃD

¦bÀɮפº¦³¤@­Ó¤u§@ªí"SAMPLE"
§Æ±æ³]©wµ{¦¡
¥i¥H¿é½Æ»s¤u§@ªí¼Æ¶q
¦Ó½Æ»s§¹«áªº¤u§@ªí¦WºÙ±q¥ª¦Ü¥k¥Ñ1¶}©l
¦ý¸g±`¨ì¤¤³~·|¥X²{°õ¦æ¶¥¬q¿ù»~
½Ð°Ý¨º¸Ì¥X°ÝÃD©O?
©Î¦³¨S¦³¨ä¥L§ó¦nªº¤èªk¶Ü?

Sub ½Æ»s¤u§@ªí()
Dim i As Integer
Dim no As Integer
Dim e As Integer

i = Application.InputBox("½Ð¿é¤J¼Æ¦r" & Chr(10) & "©Î«ö '¨ú®ø' °±¤î¥¨¶°", _
           "½Æ»s¤u§@ªí±i¼Æ", Type:=1)
If i > 0 Then
e = i
For no = 1 To i
Worksheets("sample").Copy before:=Worksheets(1)
    Sheets(1).Name = e
e = e - 1
Next no
End If
End Sub

¦^´_ 1# enoch
¨S¦³¿ù»~: ½Ð¶Ç¤W¦³¿ù»~ªºÀÉ®×

TOP

¥»©«³Ì«á¥Ñ alexliou ©ó 2012-3-29 18:20 ½s¿è

Worksheet ªº Name ÄÝ©ÊÀ³¬°¦r¦ê(String)­È
¥u­n§â  Sheets(1).Name = e §ï¬°  Sheets(1).Name = Str(e) §Y¥i

¦ý§Ú¤]¸Õ¤F§A­ì¨Óªºµ{¦¡
¦ü¥G¥Î¼Æ¦r¤]OK
Alex

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-29 18:35 ½s¿è

¦^´_ 1# enoch


    ­Ó¤H²q´ú~
     ¬O¦]¬°¦³­«ÂЦWºÙªºsheet¦s¦b~ ¾É­P¥u°õ¦æ¨ì¤@¥b´NÂ_±¼~
     À³¥Î¥H«eG¤j¤j±Ðªº¤è¦¡,¬å±¼¤£µ¥©óSampleªºsheet´N¤£·|¦³°ÝÃD
     ¦ýÁÙ¬O­n¬Ý§Aªº»Ý¨D¬O¤°»ò,¤~¯à°÷¹ï¯g¤UÃÄ
  1. Sub ½Æ»s¤u§@ªí()
  2.     Dim i As Integer
  3.     Dim no As Integer
  4.     Dim e As Integer
  5.    
  6.     i = Application.InputBox("½Ð¿é¤J¼Æ¦r" & Chr(10) & "©Î«ö '¨ú®ø' °±¤î¥¨¶°", _
  7.                "½Æ»s¤u§@ªí±i¼Æ", Type:=1)
  8.     If i > 0 Then
  9.     e = i
  10.     '=====±N¤£µ¥©ósample§R°£¡A¦A­«·s·s¼W====
  11.         Application.DisplayAlerts = False
  12.         For Each A In Sheets
  13.             If A.Name <> "sample" Then
  14.                A.Delete
  15.             End If
  16.         Next
  17.         Application.DisplayAlerts = True
  18.      '=======================================
  19.         For no = 1 To i
  20.             Worksheets("sample").Copy before:=Worksheets(1)
  21.                 Sheets(1).Name = e
  22.             e = e - 1
  23.         Next no
  24.     End If
  25. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¥»©«³Ì«á¥Ñ enoch ©ó 2012-3-30 10:45 ½s¿è

¤W¶Ç¦³ÃöÀÉ®×, ·í¤¤ªº½Æ»s¤u§@ªíµ{¦¡
½Ð«ü±Ð

¥t¦hÁÂhugh0620 ªº´£ÂI
²{®É½Æ»s¤u§@ªí¤§«e, »Ý­n¥Î¤H¤â§R°£­ì¥ý¤u§@ªí, ¦A·s¼W
²{¦b¥i¦Û°Ê²M°£¤F, ¦ý·í¤¤ a In Sheets ªº a, À³¸Ódim as ?

copy sheets.zip (85.66 KB)

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-30 12:29 ½s¿è

¦^´_ 5# enoch


http://forum.twbts.com/viewthread.php?tid=2855&highlight=
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 5# enoch


    dim A as worksheet
for each A in Sheets
´N¬O¥H©Ò¦³¤u§@ªí§@°j°é¡AAÅܼƥNªí¤@­Ó¤u§@ªí
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

        ÀR«ä¦Û¦b : ¤@¥y·Å·xªº¸Ü¡A´N¹³©¹§O¤H¨­¤WÅx­»¤ô¡A¦Û¤v·|ªg¨ì¨â¤Tºw¡C
ªð¦^¦Cªí ¤W¤@¥DÃD