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

[µo°Ý] ¦p¦ó¥i¨Ï d.keys ¦U¶µ­«§@±Æ§Ç°Ê§@?

[µo°Ý] ¦p¦ó¥i¨Ï d.keys ¦U¶µ­«§@±Æ§Ç°Ê§@?

½Ð±Ð½Ñ¦ì¤j¤j
    Dim d As Object , a
    Dim r As Range
    Sheets("¾Ç¥Í¸ê®Æ").Activate
    Set d = CreateObject("Scripting.Dictionary")
            With Sheets("¾Ç¥Í¸ê®Æ")
                For Each r In .Range(.Cells(2, 1), .Cells(65536, 1).End(xlUp))
                    d(r.Value) = r.Value
                Next
            End With
     a=d.keys
     ComboBox1.List = d.keys
   End Sub
½Ð±Ð
    ¦p¦ó¥i¨Ï d.keys ¦U¶µ­«§@±Æ§Ç°Ê§@ (µ²ªG¨Ïa(0),a(1),a(2)-----¬O»¼¼W±Æ§Ç)?
                                                           ÁÂÁ«ü¾É

¦^´_ 1# yangjie
  1. Option Explicit
  2. Sub Ex()
  3.     Dim d As Object, i As Integer, r As Range, A
  4.     'Sheets("¾Ç¥Í¸ê®Æ").Activate
  5.     Set d = CreateObject("Scripting.Dictionary")
  6.     With Sheets("¾Ç¥Í¸ê®Æ")
  7.         For Each r In .Range(.Cells(2, 1), .Cells(65536, 1).End(xlUp))
  8.             d(r.Value) = r.Value
  9.         Next
  10.         ReDim A(1 To d.Count)
  11.         For i = 1 To d.Count
  12.             A(i) = d(Application.WorksheetFunction.Small(d.KEYS, i))
  13.         Next
  14.         .ComboBox1.List = A
  15.      End With
  16.    End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 1# yangjie

¸ê®Æ¬O¤å¦r©Î¬O¼Æ­È?
­n³q¥Î´N­n¥H¦r¤¸½X±Æ§Ç
  1. Sub ex()
  2. Set d = CreateObject("Scripting.dictionary")
  3. For Each a In Range([A1], [A1].End(xlDown))
  4.   k = 0
  5.   For i = 1 To Len(a)
  6.      k = k + Asc(Mid(a, Len(a) - i + 1, 1)) * 10 ^ i
  7.   Next
  8.   d(k) = a.Value
  9. Next
  10. ComboBox1.Clear
  11. For i = 1 To d.Count
  12.    ComboBox1.AddItem d(Application.Small(d.keys, i))
  13. Next
  14. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 2# GBKEE
ÁÂÁÂGBKEE
§¹¥þ¤F¸Ñ

TOP

¦^´_ 3# Hsieh
ÁÂÁÂHeish ª©¤j
For i = 1 To Len(a)
     k = k + Asc(Mid(a, Len(a) - i + 1, 1)) * 10 ^ i
Next
¦³·N«ä
"08"  "10"  "11"  "01" "02"¥i±Æ§Ç¦¨ "01"<"02"<"08" <"10"<"11"  ¶Ü?
   "01"<"1"¶Ü?

TOP

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

¦^´_ 5# yangjie
¤£­n·Q½ÆÂø¤F,¼Æ¦r,¤¤¤å,­^¤å,¥i¥H ¤@°_¨Ó
  1. Option Explicit
  2. Sub Ex()
  3.     Dim d As Object, r As Range
  4.     'Sheets("¾Ç¥Í¸ê®Æ").Activate
  5.     Set d = CreateObject("Scripting.Dictionary")
  6.     With Sheets("¾Ç¥Í¸ê®Æ")
  7.         For Each r In .Range(.Cells(2, 1), .Cells(65536, 1).End(xlUp))
  8.             d(r.Value) = r.Value
  9.         Next
  10.         With .Cells(1, .Columns.Count).Resize(d.Count)  '¤u§@ªíªº³Ì¥k¤@Äæ
  11.             .Value = Application.WorksheetFunction.Transpose(d.KEYS)
  12.             .Sort Key1:=.Cells(1), Order1:=xlAscending, Header:=xlNo, MatchCase:=True
  13.             .Parent.ComboBox1.List = Application.WorksheetFunction.Transpose(.Value)
  14.             .Clear
  15.         End With
  16.      End With
  17. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# GBKEE
ÁÂÁÂGBKEE
¬O§Ú§â©Ò»Ýªºµ²ªG ¨S»¡²M·¡
ªí³æ¸Ì
TextBox1="05"       TextBox2   
TextBox3="01"       TextBox4  
TextBox5=""            TextBox6  
TextBox7="12"       TextBox8   
TextBox9="08"       TextBox10   
TextBox11="02"      TextBox12   
TextBox13="11"      TextBox14
¦p¦ó¤U»yªk  ¨Ï   TextBox2.value =3  TextBox4.value =1  TextBox6.value =""  TextBox8.value =6
                             value¬O¥¦ªº±Æ§Ç

TOP

¦^´_ 7# yangjie

   
ÁÙ¬O¨S»¡²M·¡
½Ð¤W¶ÇÀÉ®×»¡©ú§Aºc·Qªº½d¨Ò
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : ¦³¤ß´N¦³ºÖ¡A¦³Ä@´N¦³¤O¡A¦Û³yºÖ¥Ð¡A¦Û±oºÖ½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD