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

[µo°Ý] ¥Î°j°é§PÂ_sheet¦WºÙ¬O§_¬Û¦P¡A¨Ã½Æ»s(¤w¸Ñ¨M~·PÁ¦U¦ì)

[µo°Ý] ¥Î°j°é§PÂ_sheet¦WºÙ¬O§_¬Û¦P¡A¨Ã½Æ»s(¤w¸Ñ¨M~·PÁ¦U¦ì)

¥»©«³Ì«á¥Ñ iceandy6150 ©ó 2012-2-22 21:54 ½s¿è

§Ú¦³¨â­Ósheet¡A¤@­Ó¬O<¥\¯à>¡A¥t¤@­Ó¬O<1>
<1>¸Ì­±¦³³]©w«ö¶s¡A¯à²Î­p¸Ì­±ªº¸ê®Æ¡A§Ú­n·í¼Ë¥»
<¥\¯à>¸Ì­±§Ú³]¤F¤@­Ótextbox¥i¥H¿é¤J¼Æ¶q¡AÁÙ¦³«ö¶s¡A«ö¤F·|¦Û°Ê½Æ»s¸Ó¼Æ¶qªºsheet¥[¦b<1>«á­±
               ¦Ó¥B¦WºÙ¦Û°Ê¼W¥[<2>¡A<3>¡A<4>¡A......
¥i¬O¼g¤£¤Ó¥X¨Ó¡A¨D§UªO¤W¤j¤j

Private Sub CommandButton1_Click()
    Dim E          '³o¬O¬Ý§O¤H¼gªº
    Dim a, b As String
    Dim c As Integer
b = textbox1.text   '§ì¼Æ¶q¹L¨Ó¡A©Ò¥H§âb©w¸qString

For a = 2 To b
      
    For Each E In Sheets
            If   E.Name = a   Then          '§PÂ_¥Ø«eÀɮפ¤©Ò¦³sheet¬O§_¦P¦W
              MsgBox (a + "­«ÂФF")
              c = 1
              Exit For
            Else
              c = 0
             MsgBox (a+"¥¼­«ÂÐ¥i·s¼W")
             Exit For
           End If
        Next
   
     If c = 0 Then
     Worksheets(a - 1).Copy after:=Worksheets(a - 1)
     ActiveSheet.Name = a
     End If
Next
End Sub

§Æ±æ¥Ø¼Ð¬Oa=2§PÂ_¤@¦¸¡Aa=3§PÂ_¤@¦¸.......¡C¤@¶}©l¥u¦³<1>«Ü¦n·s¼W
¦ý­Y§â¼Æ¶q±q5§ï8¡A¦A«ö¤@¦¸¡A·Ó²z»¡<1><2><3><4><5>·|Åã¥Ü­«ÂФF¡A¥u·s¼W<6><7><8>
¤£¹L¦n¹³¶]¤£¥X¨Ó¡A°j°é¦n¹³¤]°j¤F¦n´X¦¸ @_@"
«¢Åo~¤j®a¦n§r

¦^´_ 16# Hsieh


    ·PÁ±zªº¸Ñµª

¦]¬°§Ú¬OÀ°¦£§ï¨}¡A¨Ï¥ÎªÌ¬O¤¤¦~¥H¤Wªº¼Ú¤Ú®á¤F
¤ÓÃøªºªF¦è©È¦o¤£·|¥Î¡A¦o¤]²ßºDªº¤è¦¡¤F
¤£µM¸ê®Æ®wªº½T¬O¦nª«
(¬Ý¦oªº°µªk¯Âºé¥ÎEXCEL¥h«ü©wµM«á¥[´î­¼°£¡AÀɮפj±o¤£±o¤F¡A¤S®e©ö¥X¿ù)

«ÜÁÂÁ¤j®a¼ö¤ß¸Ñµª³á!
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 15# iceandy6150
±N¾P°â²Ó¥Ø¥H¸ê®Æ®w«¬ºAÀx¦s¤~¬O¥¿¹D
­Y§A¤@©w­n±N¨C±i¾P°â³æ°µ¦¨¤@­Ó¤u§@ªí¡A¦b²Î­p¤W·|«Ü³Â·Ð
·íµM§Aªº¤èªk¥h§ä¨C±i¤u§@ªíµM«á§ä¨ì«~¦W»P¼Æ¶q«á¥h²Î­p·íµM¤]¦æ¡A¤£¹L³o¼Ë¤£¬O®ö¶O«Ü¦hªÅ¶¡»P®É¶¡¶Ü?
¦Ü©ó§A»¡ªº¤u§@ªí¦WºÙ¬O¼Æ¦r®É­n¦p¦ó«ü©w
´N¬O±N¼Æ¦rÂন¦r¦ê
¨Ò¦p
for i=1 to 5
sheets(cstr(i)).select
next
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 14# hugh0620

¦]¬°Àɮ׻ݭn¥ÎEXCEL¥h­pºâ¡A¨C¤é­n¦L¤é³øªí¡AÁÙ¦³¤W¤¤¤U¦¯³øªí(1~10¡B11~20¡B21~30)¡A¤ë³øªí
«~¶µ¥i¯à°ª¹F60¶µ¡A¨C­Ó¤ë«~¶µ¦h¤Ö·|§ó°Ê¡C¤ñ¦p½s¸¹1¬O¶ÂªQ¨T¤ô¡A¤U­Ó¤ë¥i¯à§ï¨Ä¨Ä
¥Îsheetªº¸Ü¡A¨Ï¥ÎªÌ¥u»Ý­n§ï¦r¡A¦¯³ø©M¤ë³øªº¦WºÙ¡B³æ»ùµ¥¥i¥H¥Î ='1'!C3 ³oºØ¤è¦¡³s±a§ó°Ê

©Ò¥H 1¤é.xlsÀɮפ¤¥i¯à¦³20±i³æ¡A2¤é.xls¥i¯à¦³30±i³æ....¥H¦¹Ãþ±À
¦]¬°¤£·Q©T©w¨C¤Ñ³£50­Ósheet¡A¤~·Q»¡¯à¤£¯à¥Î·s¼Wªº¥\¯à

¨C±i³æ(sheet)¨ÌÁʶRªÌ¸ê®Æ¿é¤J¦U«~¶µªº¼Æ¶q¡A¨Ò¦p¨Ä¨Ä6¥]¡A¨T¤ô5Åø¡A...µ¥
¦A¦C¦L¥X¨Ó (Ãþ¦üµo²¼¨t²Î¡A¥u·|¦L¥XÁʶRªÌ¦³¶Rªºª««~¡A¨S¶Rªº¤£¦L) ¡C³o³¡¤À§Úok

±µ¤U¨Ó¬O­pºâ¤é³øªí
¦p¦ó§âsheetªº¦WºÙ¥ÎÅܼƥh«ü©w¡A¬ã¨s¤£¥X¨Ó

sheet¦WºÙ¬°1ªº«~¶µ1ªº¼Æ¶q+<2>ªº«~¶µ1ªº¼Æ¶q+<3>ªº«~¶µ1ªº¼Æ¶q+.....+¨ì³Ì«á¤@±i³æ
³]i=1   sheet(i)·|¬OÀɮפ¤²Ä¤@­Ósheet¡A¦Ó¤£¬OÀɮפ¤¦WºÙ¬°1ªºsheet

¥d¦b³o¸Ì......>"<
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 13# iceandy6150

    ¼Ó¥D¤j­P¤WÀ³¸Ó¥i¥H«÷´ê¥X¨Ó~ §A¤j·§­nµ²ªG~
    ¦pªG­n¨Ì±z­ì©lªº¼gªk~ ¬yµ{¤W¤j·§´N·|¬O¦p¤U
    ÀÉ®×Àx¦sªº¤è¦¡
        ±Ä¥Î¤@¤Ñ¤@­ÓFILE
   ¨C­ÓÀɮתº°õ¦æ¤è¦¡
    1.¿é¤J
        1.1. ¥ý¦æ®i¶}N­ÓÁʪ«²M³æ
        1.2. ¨Ì¯È¥»Áʪ«²M³æ¤@­Ó¤@­Ó¿é¤J¨ì¨C­ÓSHEET
        1.3.  ·íÁʪ«²M³æ¦³¥[°l®É~ ¦A¥h®i¶}·s¼W´X­ÓSHEET
    2. ­pºâ
        2.1 ²Î­pÀɮפ¤¨C¤@­ÓSHEETªº¼Æ¶q
     (¾·~¯f~ ¤ñ¸û·|¥ý±q¾ã­Ó§@·~¬yµ{¨Ó«ä¦Ò«á~ ¦A¥h³]­p¾A·íªº¤u¨ã~ )
     (­Yı¤£¾A¥Î~ ·Q²¤¹L­ò~~)
     ­Y¬O¨Ì¤W­zªº¤è¦¡¦b³B²z~ ­Ó¤H·|¤ñ¸û«Øij§ïÅܬyµ{
     «ä¦ÒÂI:  
          ­Y¸ê®Æ¬O¤@±i±i¯È¥»¸ê®Æ¿é¤J¨ìEXCELªº¸Ü
          ¤£«Øij¥Î®i¶}SHEETªº¤è¦¡¨Ó³B²z
          «Øij:³]­p¤@­Óª«¥óªí³æ¨Ó³B²z~ ¤Ï¦Ó·|§ó¾A¦X
          ¦p¤U¹Ïªº¤è¦¡
         
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¥»©«³Ì«á¥Ñ iceandy6150 ©ó 2012-2-17 11:24 ½s¿è

¦^´_ 10# hugh0620

§A¦n¡A§Ú¥Ø«eªº»Ý¨D¬O¡A¤@­ÓÀɮ׸̭±¦³¤@­Ósheet¦WºÙ¥u¥s°µ1¡A(¨ä¹ê¬OÁʪ«²M³æ1)
µM«á§Ú­n²£¥Í20¥÷(textbox¿é¤J)¡A´N·|¦³20±iÁʪ«²M³æ¡A·íµM¨C±i³æªºÁʪ«¤º®e¤£¤@
¨Ò¦p¥Í·N¦n¡A­n°l¥[¨ì30¥÷¡Atextbox¿é¤J30¡A«ö¶s²£¥Í¡A«e20±i³æ¥²¶·«O¯d¤£°Ê¡A¥u·s¼W21~30
©Ò¥H¤~­n¼g¨¾§b¡AÁקK¤â»~§â«e20¥÷³æµ¹¬å¤F¡C

²{¦b§Ú¹J¨ì¤@­Ó°ÝÃD¡A¨C¤é­n²£¥Í¤é³øªí
§Ú¼g¤@­Ófor¥h¶]¨C±i³æ(¨C­Ósheet)ªº¨C­Ó«~¶µ¬Ý¼Æ¶q¦h¤Ö

°²³]¨C±i³æ¦³10ºØ²£«~
¤µ¤Ñ¦³20±i³æ   textbox¿é¤J20   ­n²Î­p¨CºØ²£«~½æ¥X¦h¤Ö
for i=1 to Val(TextBox1)
       t=t+worksheets(i).cells(1,1).value      <---³oÃä­n«ç»ò«ü©w¦W¦r¬°1ªºsheet¡C worksheets(1)·|Åܦ¨Àɮ׸̭±²Ä¤@­Ósheet¡A«Ü¥i¯à¬O<¥\¯à>©Î<©R¥O>
end for
§Ú¯uªº¤£¤Ó·|¤F
«¢Åo~¤j®a¦n§r

TOP

¦^´_ 10# hugh0620
¨ú·s¼W³Ì¤j½s¸¹
  1. Private Sub CommandButton1_Click()
  2. Application.ScreenUpdating = False
  3. For Each sh In Sheets
  4.    If IsNumeric(sh.Name) Then s = CInt(sh.Name)
  5. Next
  6. k = Val(Sheets(1).TextBox1)
  7. If k > s Then
  8. For i = 1 To k - s
  9.   Sheets(1).Copy after:=Sheets(Sheets.Count)
  10.   ActiveSheet.Name = CStr(s + i)
  11. Next
  12. End If
  13. Application.ScreenUpdating = True
  14. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2012-2-17 10:31 ½s¿è

¦^´_ 8# iceandy6150
¦^´_ 10# hugh0620
  1. Private Sub CommandButton2_Click()
  2.     Dim xSH As Integer, Sh As Worksheet, xi As Integer, A As Integer
  3.     A = 6
  4.     For Each Sh In Sheets
  5.         If IsNumeric(Sh.Name) Then xSH = xSH + 1
  6.     Next
  7.     If xSH = 0 Then Exit Sub   '³o¸Ì ¥i°£¿ù
  8.     For xi = xSH + 1 To A
  9.         Sheets("1").Copy , Sheets(Sheets.Count)
  10.         Sheets(Sheets.Count).Name = xi
  11.     Next
  12. End Sub
½Æ»s¥N½X

TOP

¼Ó¥D~
G¤j¤j©ÎH¤j¤j³£¬O«Ü¼F®`ªº°ª¤â~

¦ý¯¸¦bSAªº¨¤«×~ ¨ä¹êÁÙ¬O·|¦³¤@©wªºBUG¦s¦b
G¤j¤jªºµ{¦¡½X~ ·ísheet.Name ¤£¬O¥X²{ªº³sÄò¸¹½X~ ·|²£¥Í¿ù»~
¦p textbox1.text=6 °õ¦æ«á~
¦AÀH«K¬å±¼«Dsheet.name=6ªº¥ô¦ó¤@±isheet~ ¦A­«·s°õ¦æ®É~ ´N·|²£¥Íbug

­Y¤£¦Ò¶q¤w¦³ªºsheet¬O»Ý­n³Q«O¯dªº~ «Øij«O¯d°ò¥»ªºsheet~ ¨ä¥L1,2,3...sheet «Øij§R°£«á~
¦A­«·s¶]¥X¨Ó~
¨Ò.¨C¤@¦¸sheet1¶]¥Xªº¸ê®Æ,³£¤@¼Ë~ ´N¥i¥H¥Î¦¹¤è¦¡
¨Ò.²Ä¤@¦¸¶]¥Xsheet1ªº¸ê®Æ»P²Ä¤G¦¸¶]¥X¨Óªºsheet1¤£¤@¼Ë®É~ ´N¤£¯à³o¼Ëªº¤è¦¡~

¼Ó¥D~  ´£¨Ñ³o¨Ç«Øij¬O¦]¬°¦³®É¨Ï¥ÎªÌ¤£¬O¦Û¤v®É~ ·|²£¥Í¤£¦Pªº¥i¯à©Ê~
¦b³]­p®É~ ¯àºÉ¶q¦Ò¶qªº§¹¾ã~ ¤Îµ²¦X¤@¨Ç¹w¨¾¥i¯àµo¥Íªº¦]¯À~
·|Åý§A³]­p¥X¨Óªº¤u¨ã¯à°÷¯u¥¿ªº³Q¨Ï¥Î~
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

ª©¥D¤j¤j~~§Ú­×§ï¤F¤@¤U¡A¥i¥H¥Î¤F­C
¦n´Îªü!!!!
Private Sub CommandButton2_Click()
   
    Dim xSH As Integer, Sh As Worksheet, xi As Integer, A As Integer
    A = Val(TextBox1)
    For Each Sh In Sheets
        If IsNumeric(Sh.Name) Then xSH = xSH + 1
    Next
    For xi = xSH + 1 To A
        Sheets("1").Copy , Sheets(Sheets.Count)
        Sheets(Sheets.Count).Name = xi
    Next

End Sub

·PÁ¦A·PÁÂ~~
«¢Åo~¤j®a¦n§r

TOP

        ÀR«ä¦Û¦b : ª¾ÃÑ­n¥Î¤ßÅé·|¡A¤~¯àÅܦ¨¦Û¤vªº´¼¼z¡C
ªð¦^¦Cªí ¤W¤@¥DÃD