I have a form that gives the user 2 choices. Based on the choice, a listbox is supposed to fill with a list of possible file choices to select...with the possibility of cancelling and going back to the initial choices.
Here is the example of the issue I encounter...
User selects Choice 1, listbox populates correctly, user cancels and then selects Choice 2...listbox populates with same list as before.
From the 1st Form/Choices there is the following...
Then there's this code on the form with the listbox...
Here is the example of the issue I encounter...
User selects Choice 1, listbox populates correctly, user cancels and then selects Choice 2...listbox populates with same list as before.
From the 1st Form/Choices there is the following...
Code:
Private Sub Something_Click()
MyFile = Dir(MyFolder & "Something *.xlsm")
.
.
.
End Sub
Private Sub SomethingElse_Click()
MyFile = Dir(MyFolder & "Something.Else*.xls")
.
.
.
End Sub
Code:
Private Sub UserForm_Initialize()
Do While MyFile <> ""
FileListForm.ListBox1.AddItem MyFile
MyFile = Dir
Loop
End Sub