
ComboBox1.RowSource = "ELENCO!A1:A20" |
Private Sub ComboBox1_Enter()
Dim rng As Range, cella As Range
Set rng = Range("a1:a20, b1:b20, c1:c20")
For Each cella In rng
If cella.Value <> "" Then ComboBox1.AddItem cella.Value
Next
End Sub
|
Private Sub ComboBox1_Enter()
Dim r As Integer, c As Integer
Dim col As Collection, v As Variant
ComboBox1.Clear
For c = 1 To 3
Set col = New Collection
For r = 1 To 20
On Error Resume Next
If Cells(r, c) <> "" Then
col.Add Cells(r, c).Value, CStr(Cells(r, c).Value)
End If
Next
For Each v In col
Me.ComboBox1.AddItem v
Next
Next
End Sub
|
Private Sub ComboBox1_Enter()
Dim r As Integer
With ComboBox1
.Clear
.ColumnCount = 3
.ColumnWidths = "30;30;30"
For r = 0 To 19
.AddItem Cells(r + 1, 1).Value
.List(r, 1) = Cells(r + 1, 2).Value
.List(r, 2) = Cells(r + 1, 3).Value
Next
End With
End Sub
|
Private Sub ComboBox1_Change()
On Error Resume Next
With ComboBox1
.Text = .Column(0) & "-" & .Column(1) & "-" & .Column(2)
End With
End Sub
|
