Link to home
Start Free TrialLog in
Avatar of sq30
sq30

asked on

Open file and copy sheet from newly opened workbook the close.

Hello,

Please help me expand the code below to copy sheet 1 from the newly opened file to the current file and then close the newly opened file.

Thank you


Sub ImportSheet()

        Dim fileName
        fileName = Application.GetOpenFilename("Other Workbook (*.xl*),*.xl*")
        If fileName = "False" Then
        MsgBox "You have not selected a file. Please try again."
        GoTo QuitSub
        End If
        Workbooks.Open fileName:=fileName
        
QuitSub:
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sq30
sq30

ASKER

Perfect - Thank you.