Pinaceous
Well-known Member
- Joined
- Jun 11, 2014
- Messages
- 1,124
- Office Version
- 365
- Platform
- Windows
Hi All,
I'm working with a great macro that allows the user to select a specific excel file in importing it into their already open excel workbook.
Have at it and run the code.
It pops up your typical file to open box.
Now my question is; if the user clicks the 'Cancel' button I'd like a for a message box to pop up and say:
and then to
Can someone help me piece this together??
Thank you!
Pinaceous
I'm working with a great macro that allows the user to select a specific excel file in importing it into their already open excel workbook.
Code:
Dim wsDest As Worksheet
Set wsDest = ActiveWorkbook.Sheets(11)
Application.ScreenUpdating = False
On Error Resume Next
With Workbooks.Open(Application.GetOpenFilename("Excel Files, *.xls*"))
.Sheets(10).Range("A1:Q178").Copy wsDest.Range("A1:Q178")
.Close False
End With
On Error GoTo 0
Application.ScreenUpdating = True
Set wsDest = Nothing
Have at it and run the code.
It pops up your typical file to open box.
Now my question is; if the user clicks the 'Cancel' button I'd like a for a message box to pop up and say:
Code:
MsgBox "Not IMPORTING File!!"
and then to
Code:
Exit Sub
Can someone help me piece this together??
Thank you!
Pinaceous
Last edited: