Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. Private Sub UserForm_Initialize()
  2. Dim FileList(), i As Long, x, n As Long, fName As String
  3. FilePath = "D:TGSvidasmerger" 'change to suit
  4. fName = Dir(FilePath & "*.xls")
  5. i = 1
  6. Do While fName <> ""
  7. ReDim Preserve FileList(1 To i)
  8. FileList(i) = fName
  9. i = i + 1
  10. fName = Dir()
  11. Loop
  12.  
  13. ReDim Preserve FileList(1 To i - 1)
  14. With Me.ListBox1
  15. .Clear
  16. .List = FileList
  17. End With
  18. textbox.Value = ListBox1.Value
  19. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement