#1
|
|||
|
|||
show folders and files in listbox
Hi all,
I have a listbox that with the push of a button shows me all the files in the folder. The path is hard coded. I would like to avoid hard code all the folders so when I push a button, it shows the files from that folder. Is there a way the code could be adjusted so it would show the folders and files in one listbox like below: Folder1 file1 file2 Folder2 file1 file2. This is the code I have now: Code:
Private Sub Command23_Click() Dim LoadFiles As String Dim strFill As String LoadFiles = Dir$("C:\Messages\*.*") Do While LoadFiles > "" strFill = strFill & LoadFiles & ";" LoadFiles = Dir$ Loop List21.RowSource = strFill End Sub |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
This is a Userform LIstbox queston: A variable does not set to the value of a listbox | CatMan | Excel Programming | 14 | 08-18-2014 08:14 PM |
list folders and files using .vbs file | josianne | Excel Programming | 3 | 08-18-2014 03:03 PM |
This is a Userform LIstbox queston: A variable does not set to the value of a listbox | CatMan | Excel | 1 | 08-08-2014 09:41 AM |
copy, sync files across 2 folders 1 pc | spgprivate | Office | 0 | 06-20-2013 08:41 AM |
Outlook folders default show most recent message | gregp | Outlook | 0 | 04-16-2013 12:56 AM |