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

[µo°Ý] ComboBox ¸Ìªº¸ê®Æ±Æ§Ç

[µo°Ý] ComboBox ¸Ìªº¸ê®Æ±Æ§Ç

½Ð°ÝComboBox ¸Ìªº¸ê®Æ±Æ§Ç°ÝÃD.
ComboBox1 ªº¸ê®Æ¨Ó·½¬OSheet1.Range("A1:A20"), ¥´¶}¤U©Ô¦¡¿ï³æ®É, ³æ¾Ú¸¹½X¯à¦Û°Ê±Æ§Ç,½Ð°ÝVBA¦p¦ó¼g¡H

Sheet1.Range("A1:A20")¸ê®Æ¦p¤U¡G
C1-1301001
C2-1302003
C1-1303004
C1-1302001

¥´¶}¤U©Ô¦¡¿ï³æ®É,¦Û°Ê±Æ§Ç¬°¡G
C1-1301001
C1-1302001
C1-1303004
C2-1302003
learner

½Ð°ÝComboBox ¸Ìªº¸ê®Æ±Æ§Ç°ÝÃD.
ComboBox1 ªº¸ê®Æ¨Ó·½¬OSheet1.Range("A1:A20"), ¥´¶}¤U©Ô¦¡¿ï³æ®É, ³æ¾Ú ...
yliu µoªí©ó 2013-5-23 21:13
  1. Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  2.   Range("A1:A20").Sort Key1:=Range("A1")
  3. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# luhpro


    ÁÂÁÂluhpro.
¦ý§Úªº¸ê®Æ, °£¤FAÄæ¥~,ÁÙ¦³ BÄæ~MÄæ, AÄæÁö¦³­«·s±Æ§Ç, ¦ýBÄæ~MÄæ¸ê®Æ¨S¦³¸òµÛ¤@°_±Æ§Ç.
½Ð°Ý¦³¥i¯à¥u¦b¤U©Ô¦¡¿ï³æ±Æ§Ç§Y¥i,¦Ó¤£°Ê­ì¦³ªº¸ê®Æ¶Ü?
learner

TOP

¦^´_ 3# yliu


    ±z¦n¡G

  ½Ð¸Õ¸Õ¤U¦C¤èªk¬O§_
¦X¾A
Private Sub ComboBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
   
    Dim mSht As Worksheet
    Dim mRng As Range, mRng1 As Range
        
    Set mSht = Worksheets(1)
    With mSht
        Set mRng = .Range("a1:a20")
        Set mRng1 = .Range("w1:w20")
        mRng1.Value = mRng.Value
        With mRng1
            .Sort key1:=.Columns("a"), header:=xlGuess
        End With
        With UserForm1.ComboBox1
            .List = mRng1.Value
            .ListIndex = -1
        End With
        mRng1.Value = ""
    End With
   
End Sub

TOP

¦^´_ 3# yliu
  1. Private Sub ComboBox1_GotFocus()
  2.     Dim Ar, I
  3.     ReDim Ar(1 To [a1:a20].Count)
  4.     For I = 1 To [a1:a20].Count
  5.         Ar(I) = Application.Small([a1:a20], I)
  6.     Next
  7.     ComboBox1.List = Ar
  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 5# GBKEE

GBKEE §A¦n ,
·|¥X²{°õ¦æ¶¥¬q¿ù»~¡¦70¡¦ ¨S¦³¨Ï¥ÎÅv­­, °»¿ù¸¨¦bComboBox1.List = Ar
½Ð°Ý¬O¤°»ò·N«ä?
learner

TOP

¦^´_ 4# dechiuan999

dechiuan999 §A¦n ,
·|¥X²{°õ¦æ¶¥¬q¿ù»~¡¦70¡¦ ¨S¦³¨Ï¥ÎÅv­­, °»¿ù¦b.List = mRng1.Value
learner

TOP

¦^´_ 7# yliu
½Ð§A§âÀɮפW¶Ç,¤~ª¾¹D¿ù»~¦b­þ¸Ì!!
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# GBKEE


    GBKEE §A¦n ,
¤w°£¿ù¤F, ÁÂÁÂ!  §Ú¦bComboBox1ªºListFillRangeÄÝ©Ê©ñ¤F©w¸q¦WºÙ, ®³±¼¥H«á,´N¤£¦A¥X²{¿ù»~.
learner

TOP

¦^´_ 4# dechiuan999
dechiuan999 §A¦n ,
¦P¼Ëªº,±Ä¥Î§Aªº¤è¦¡¤]¥i¥H¤F, ÁÂÁÂ! §Ú¦bComboBox1ªºListFillRangeÄÝ©Ê©ñ¤F©w¸q¦WºÙ, ®³±¼¥H«á,´N¤£¦A¥X²{¿ù»~.
learner

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD