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

[µo°Ý] ½Ð°Ý¬O§_¥i¥H¥ÎÀx¦s®æªº¸ê®Æ¨Ó±Æ§Ç¤u§@ªí

[µo°Ý] ½Ð°Ý¬O§_¥i¥H¥ÎÀx¦s®æªº¸ê®Æ¨Ó±Æ§Ç¤u§@ªí

¥»©«³Ì«á¥Ñ luffyzoro ©ó 2011-11-29 15:42 ½s¿è

¦U¦ì°ª¤â
¤£¦n·N«ä,¤S­n¨Ó½Ð±Ð

°²³]AÀɮפ¤¦³¦h­Ó¤u§@ªí,¦ý¨ä®æ¦¡³£¤@¼Ë
¦pªG­n¥Î¨C­Ó¤u§@ªíªºB2Àx¦s®æ´À¤u§@ªí±Æ§Ç
B2Àx¦s®æ¬O¼Æ­È
¤u§@ªí«h¥ÑB2Àx¦s®æªº¤j¤p,¥Ñ¥ª¨ì¥k¨Ì§Ç¬°¥Ñ¤p¨ì¤j

½Ð°Ý¬O§_¥i¯à§¹¦¨

¦^´_ 1# luffyzoro
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Sh As Worksheet
  4.     For Each Sh In Sheets
  5.         Sh.Move Sheets(Sh.[b2])
  6.     Next
  7. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# GBKEE


ª©¤j±z¦n,

Sh.Move Sheets(Sh.[b2])°õ¦æ¨ì³o¤@¦æ®É¥X²{  °õ¦æ¶¥¬q¿ù»~"13" «¬ºA¤£²Å
½Ð±Ðª©¤j
Sh.Move Sheets(Sh.[b2])³o¦æªº·N«ä¬O? Sheets(sh.[b2])¬O«üworksheets¤¤ªº¨C¤@sheetªºÀx¦s®æb2¶Ü?

·PÁª©¤jªº¨³³t¦^ÂÐ

TOP

¦^´_ 3# luffyzoro
  1. Sub nn()
  2. Set d = CreateObject("Scripting.Dictionary")
  3. Set d1 = CreateObject("Scripting.Dictionary")

  4. For Each sh In Sheets
  5.   k = k + 1
  6.   d(k) = sh.[B2].Value
  7.   d1(k) = sh.Name
  8. Next
  9. Do Until d.Count = 0
  10. ar = d.items: ay = d.keys
  11.   n = Application.Match(Application.Min(ar), ar, 0) - 1
  12.   ky = ay(n)
  13.   d.Remove ky
  14.   Sheets(d1(ky)).Move after:=Sheets(Sheets.Count)
  15. Loop
  16. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 3# luffyzoro
Sh.Move Sheets(Sh.[b2])°õ¦æ¨ì³o¤@¦æ®É¥X²{  °õ¦æ¶¥¬q¿ù»~"13" «¬ºA¤£²Å
[b2]  ¶·¬O¼Æ¦r  >0 ¥B < =Sheets.Count(¤u§@ªíªºÁ`¼Æ)  

For Each Sh In Sheets                     -> ¦b Sheets¤u§@ªí¶°¦X(ª«¥ó) ,  ¨Ì§Ç³B¸Ì Sh(¤u§@ªí).
       Sh.Move Sheets(Sh.[b2])        ->Sh(³o¤u§@ªí) ªº[b2]

TOP

¥»©«³Ì«á¥Ñ luffyzoro ©ó 2011-11-29 17:04 ½s¿è

¦^´_ 4# Hsieh


ª©¤j±z¦n,

ÁöµM±z¼gªº§Ú´X¥G¬Ý¤£À´.......
¦ý¬Oµ{¦¡¸Õrunªºµ²ªG¬Ookªº.......¦]¬°§Ú±NÀx¦s®æ¤º®e§ï¬°¼Æ¦r
¤~µo²{§Úªº´£°Ý¬O¿ùªº
½Ð°Ý¦pªGÀx¦s®æb2ªº¤º®e­Y¬O   '0753333   ³oºØ®æ¦¡ªº¸Ü
»Ý­n¦p¦ó°µ­×§ï
©êºp,³s°ÝÃD³£¼gªº¤£²M·¡

ÁÂÁÂ

TOP

¦^´_ 5# GBKEE


¬Oªº,ª©¤j

§Úµo²{Àx¦s®æ¬O   '0753333  ³oºØ¸ê®Æ

¯u¬O©êºp,°ÝÃD³£°Ýªº¤£²M·¡

TOP

¥»©«³Ì«á¥Ñ Hsieh ©ó 2011-11-29 20:33 ½s¿è

¦^´_ 6# luffyzoro
  1. Sub nn()
  2. Set d = CreateObject("Scripting.Dictionary")  '³Ð«Ø¦r¨åª«¥ó
  3. Set d1 = CreateObject("Scripting.Dictionary")  '³Ð«Ø¦r¨åª«¥ó

  4. For Each sh In Sheets  '¥H©Ò¦³¤u§@ªí°µ°j°é
  5.   k = k + 1  '³]¸mÅܼÆk¡A¨C¤@­Ó¤u§@ªí¼W¥[ÅܼƭÈ1
  6.   d(k) = Val(sh.[B2].Value)  '±N¤u§@ªíB2ªº­È¦s¤J¦r¨åª«¥ó
  7.   d1(k) = sh.Name   '±N¤u§@ªí¦WºÙ¦s¤J¦r¨åª«¥ó
  8. Next
  9. Do Until d.Count = 0  '°õ¦æ°j°é¡Aª½¨ì¦r¨åª«¥ó¤º¨S¦³¶µ¥Ø¦s¦b
  10. ar = d.items: ay = d.keys  '±N¦r¨åª«¥óªº¯Á¤Þ­È¤Î¤º®e¨ú¥X«ü©wµ¹°}¦CÅܼÆ
  11.   n = Application.Match(Application.Min(ar), ar, 0) - 1  '§ä¨ì³Ì¤p­Èªº§Ç¸¹¡A¦]°}¦Cªº¯Á¤Þ­È¬O±q0¶}©l¡A©Ò¥H¥²¶·±N¦ì¸m´î1¡A¤~¬O¹ï·Óªº¯Á¤Þ­È
  12.   ky = ay(n)  'ky·|±o¨ì¥Ø«e¦r¨åª«¥ó¤º®e(B2­È)ªº³Ì¤p­È¹ïÀ³ªº¤u§@ªí¦WºÙ
  13.   d.Remove ky  '²¾°£¦r¨å¶µ¥Ø
  14.   Sheets(d1(ky)).Move after:=Sheets(Sheets.Count)  '±N¤u§@ªí²¾°Ê¨ì³Ì«á
  15. Loop
  16. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 7# luffyzoro
  1. Sub Ex()
  2.     Dim AR(), AR1(), i As Integer, N As Integer, Sh As Worksheet
  3.     ReDim AR(1 To Sheets.Count)                             '³]©w°}¦Cºû¼Æ( 1 to ¤u§@ªíÁ`¼Æ)
  4.     ReDim AR1(1 To Sheets.Count)                            '³]©w°}¦Cºû¼Æ( 1 to ¤u§@ªíÁ`¼Æ)
  5.     For i = 1 To Sheets.Count
  6.         AR(i) = Val(Sheets(i).[b2])                         'Sheets(i).[b2]¼Æ¦r¸m¤J°}¦C¤¤
  7.     Next
  8.     For i = 1 To Sheets.Count
  9.         AR1(i) = Application.WorksheetFunction.Small(AR, i) '°}¦C±Æ§Ç¥Ñ¤p¨ì¤j
  10.     Next
  11.     For Each Sh In Sheets
  12.         N = Application.Match(Val(Sh.[b2]), AR1, 0)         '¨ú±o Sh.[b2] ¼Æ­È©óAR1°}¦C¤¤±Æ§Çªº¦ì¸m
  13.         Sh.Move Sheets(N)                                   '²¾°ÊSh©óSheets(N)¤§«e
  14.     Next
  15. End Sub
½Æ»s¥N½X

TOP

¦^´_ 8# Hsieh


Dim sCount%, i%, j%
      sCount = Worksheets.Count
        If sCount = 1 Then Exit Sub
        For i = 1 To sCount - 1
          For j = i + 1 To sCount
             If Worksheets(j).Range("b2").Value < Worksheets(i).Range("b2") Then
                 Worksheets(j).Move before:=Worksheets(i)
             End If
          Next
        Next
½Ð°Ýª©¤j³o¼Ë¼g»P±z¼gªº¬O§_¦³®t²§?

TOP

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD