Hi all,
I am working creating an excel tool, and part of it involves importing a sheet from one workbook into another. However, I want it to be dynamic so that the name of the sheet doesn't have to be the same.
Right now I have the following code that imports the sheet named "Import"
'get imported file
Set wb1 = ActiveWorkbook
ImportFile = Application.GetOpenFilename("Excel Files (*.xlsx*), *.xlsx*,(*.xls*), *.xls*", _
, "Please select the lane data.")
If ImportFile = False Then Exit Sub
Set wb2 = Workbooks.Open(ImportFile)
wb2.Sheets("Import").Copy Before:=wb1.Sheets("Instructions")
wb2.Close SaveChanges:=False
Is there a way to display what sheet names exist within the workbook that you want to import from, and then allow the user to select which they would like? (As is possible when importing excel data into access)
Any help or suggestions would be appreciated, thanks!
Bookmarks