I'm trying to build a VBA macro to allow a user to select a file from file Dialog and import Sheet 1 from the file to the Active VBA Workbook and to rename the Sheet as "Import". Im new to this and this is as far as I got. This allows me to open file dialog and select a file. But all it does is open up the file which isnt much help.
Sub OpenAFile()
Dim fd As FileDialog
Dim FileWasChosen As Boolean
Set fd = Application.FileDialog(msoFileDialogOpen)
fd.Filters.Add "Any Excel Files", "*.xl*"
FileWasChosen = fd.Show
If Not FileWasChosen Then
MsgBox "You didn't select a file"
Exit Sub
End If
fd.Execute
End Sub