How to read/write values to a Multi-column unbound Listbox? (1 Viewer)

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 16:04
Joined
Mar 22, 2009
Messages
777
Hi All,
I have a Multi-Column Unbound Listbox named lstfiles.
In that, I want to add the path of the files in the first column (Hidden Column) and the name of the files in the second column.

Code:
Private Sub cmdAddToList_Click()
Dim myDiag As FileDialog    'DialogBox to select Input Files
Set myDiag = Application.FileDialog(msoFileDialogFilePicker)
With myDiag
    .Title = "Please Select the Input Files"
    .AllowMultiSelect = True
    .Show
End With
For Each varSelectedItem In myDiag.SelectedItems
    lstFiles.AddItem varSelectedItem  'This adds to the first column by default
    'Here I need the code to enter values on the second column
Next varSelectedItem
End Sub

And one more help.

To read all the values (irrespective of selection) from the same listbox:

Something like:
Code:
for each item in lstfiles.items
 'Do Process
 Next item

Thanks in advance.
 

prabha_friend

Prabhakaran Karuppaih
Local time
Today, 16:04
Joined
Mar 22, 2009
Messages
777
Done with putting a ";" inside the string wherever I wanted separate the string into columns.
 

Users who are viewing this thread

Top Bottom