Hi all,
I am working on a project where the end user will use a dialog box within the "Macro" workbook to choose a file that contains the data they need. There will then be an automated process that copies data from multiple sheets within this file and pastes into the "Macro" workbook.
Because the file that they select could have a different name and file location each time, I am struggling to code for the repeated copy and paste. Could anyone help?
The code for the dialog box for choosing the file is as follows:
I need to then access this file multiple times to copy from various sheets. The sheets will have set names.
Thanks,
I am working on a project where the end user will use a dialog box within the "Macro" workbook to choose a file that contains the data they need. There will then be an automated process that copies data from multiple sheets within this file and pastes into the "Macro" workbook.
Because the file that they select could have a different name and file location each time, I am struggling to code for the repeated copy and paste. Could anyone help?
The code for the dialog box for choosing the file is as follows:
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Filters.Add "Excel Files", "*.xlsx; *.xlsm; *.xls; *.xlsb", 1
.Show
'Store in cell
Sheets("Frontsheet").Range("C8") = .SelectedItems.Item(1)
End With
I need to then access this file multiple times to copy from various sheets. The sheets will have set names.
Thanks,