Excel VBA - How to Get a List of Files using File Dialog Box

preview_player
Показать описание
Excel VBA Learn how to get list of files using file dialog box

The code used in this video:

Sub GettingFiles()
Dim SelectedFile As Variant

With Application.FileDialog(msoFileDialogFilePicker)
.Title = "Select files"
.ButtonName = "Confirm"
.InitialFileName = "C:\"
If .Show = -1 Then
'ok clicked
For Each SelectedFile In .SelectedItems
MsgBox SelectedFile
Next

Else
'cancel clicked
End If

End With

End Sub
Рекомендации по теме
Комментарии
Автор

your videos are very helpful and simple. thank you

aloknand.ravishankar