teodormircea
Active Member
- Joined
- Jan 8, 2008
- Messages
- 331
Hello forum,
i would like to fill from 2 columns the values in a listbox with the headers also from the excel fille
Here i have the code for 1 column but with out header from excel fille
In listbox properties : i have ColumnCount=2, ColumnHeads=True
i would like to fill from 2 columns the values in a listbox with the headers also from the excel fille
Here i have the code for 1 column but with out header from excel fille
In listbox properties : i have ColumnCount=2, ColumnHeads=True
Code:
Private Sub UserForm_Initialize()
Dim cell As Range
Dim Rng As Range
With ThisWorkbook.Sheets("Sheet1")
Set Rng = .Range("a2", .Range("a2").End(xlDown))
End With
For Each cell In Rng.Cells
Me.ListBox1.AddItem cell.Value
Next cell
End Sub