Code to halt a macro
if application.CutcopyMode = False then
msgbox "No range copied. Exiting . . . "
Exit Sub
End if
--
Regards,
Tom Ogilvy
"floss" wrote in message
...
Hi, I made a 'paste macro' which pastes data from clipboard to a
designated area in the worksheet. However if a user runs the macro while
there is no data in the clipboard macro error occurs. Need help with the
code (if(iserror)) so I can display a text message, noting the missing data
in the clipboard, and then terminate the macro. After which, the user will
hopefully copy the necessary data to clipboard and rerun the 'paste macro'.
Thank you in advance for all of your help...
Floss
|