Open workbook(s) using VBA

  • Thread starter Thread starter TIMOTHY
  • Start date Start date
T

TIMOTHY

Dear All

can you help me with the code of opening one or multiple workbook which are used daily

Thanks & Regards
Jeyakumar
 
hi Jeyakumar,

Sub test()
Dim Wk As Workbook, FD As FileDialog

Set FD = Application.FileDialog(msoFileDialogFilePicker)
FD.AllowMultiSelect = True
FD.Filters.Clear
FD.Filters.Add Description:="Excel Files", Extensions:="*.xls;*.xlsx"
FD.Show

If FD.SelectedItems.Count > 0 Then
For i = 1 To FD.SelectedItems.Count
Application.Workbooks.Open FD.SelectedItems(i)
Next
End If

Set FD = Nothing
End Sub
 
hi Jeyakumar,

Sub test()
Dim Wk As Workbook, FD As FileDialog

Set FD = Application.FileDialog(msoFileDialogFilePicker)
FD.AllowMultiSelect = True
FD.Filters.Clear
FD.Filters.Add Description:="Excel Files", Extensions:="*.xls;*.xlsx"
FD.Show

If FD.SelectedItems.Count > 0 Then
   For i = 1 To FD.SelectedItems.Count
     Application.Workbooks.Open FD.SelectedItems(i)
   Next
End If

Set FD = Nothing
End Sub

thanks again for reply
 
Back
Top