Open workbook(s) using VBA

T

TIMOTHY

Dear All

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

Thanks & Regards
Jeyakumar
 
I

isabelle

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
 
T

TIMOTHY

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top