largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
So I have some code and in the workbook I define a path where a number of text files are saved.
I have a userform which I would like to use to select which text file to reference. I have used other code/userforms in the past to select which open workbook I want to use.
What I want to know is how can I have the userform dropdown display the names of the text files in the folder at the path I specify?
Here is the code I have used to display the list of open workbooks in the userform in the past:
Any ideas or suggestions are much appreciated!
Thanks!
So I have some code and in the workbook I define a path where a number of text files are saved.
I have a userform which I would like to use to select which text file to reference. I have used other code/userforms in the past to select which open workbook I want to use.
What I want to know is how can I have the userform dropdown display the names of the text files in the folder at the path I specify?
Here is the code I have used to display the list of open workbooks in the userform in the past:
Code:
Private Sub UserForm_Initialize()
Me.Label1.Caption = "Please select one of the following files..."
With Me.ComboBox1
For Each wkb In Application.Workbooks
.AddItem wkb.Name
Next wkb
End With
End Sub
Any ideas or suggestions are much appreciated!
Thanks!