Hello I have the below code, which should show an error msg box and close the two workbooks the macro has already opened when there is nothing to paste.
This is working to well! as in it runs even when there is copied text.
I need code to run an error message,end sub, close the workbooks it opened when there is noting to paste, otherwise run as normal.
Thanks
This is working to well! as in it runs even when there is copied text.
Code:
Sheets("Tab 2").Select Range("A1").Select
ActiveSheet.PasteOn Error GoTo ErrorHandler
ErrorHandler:
Mainbook.Close Savechanges:=False
wb1.Close Savechanges:=False
MsgBox "Nothing to paste!": Err.Clear
Exit Sub
Range("A1:F500").Select
Selection.Style = "Normal"
I need code to run an error message,end sub, close the workbooks it opened when there is noting to paste, otherwise run as normal.
Thanks