這問題~這裡的老師們有教過我~舉例如下
Private Sub UserForm_Initialize()
Dim A As Range
Set d = CreateObject("Scripting.Dictionary")
With Sheets("Sheet1")
.Activate
For Each A In .Range("A1", .[a1].End(xlDown))
d(A.Value) = IIf(d(A.Value) = "", A.Offset(, 1).Value, d(A.Value) & "," & A.Offset(, 1))
Next
ComboBox1.List = d.keys
End With
End Sub
以上範例為~當資料在A欄~若要在其他欄位請更改這段
For Each A In .Range("A1", .[a1].End(xlDown))
若要改成B欄只要將這段的A1和a1~改成B1和b1即可
以上是麻辣教師的老師們指導的~不知道有沒有符合你要的答案!?作者: SteveChm 時間: 2014-2-11 18:06