Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub UserForm_Initialize()
- Dim FileList(), i As Long, x, n As Long, fName As String
- FilePath = "D:TGSvidasmerger" 'change to suit
- fName = Dir(FilePath & "*.xls")
- i = 1
- Do While fName <> ""
- ReDim Preserve FileList(1 To i)
- FileList(i) = fName
- i = i + 1
- fName = Dir()
- Loop
- ReDim Preserve FileList(1 To i - 1)
- With Me.ListBox1
- .Clear
- .List = FileList
- End With
- textbox.Value = ListBox1.Value
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement