Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Code to halt a macro

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
halt a subroutine question teepee[_3_] Excel Discussion (Misc queries) 3 December 28th 08 09:23 PM
Halt Rest of Macro after Error €“ Jim Cone review Jenny B. Excel Discussion (Misc queries) 2 January 12th 08 03:11 AM
"No RETURN() or HALT() function found on macro sheet." Will Excel Worksheet Functions 2 January 4th 07 10:10 PM
No RETURN() or HALT() function found on macro sheet [email protected] Excel Discussion (Misc queries) 3 September 26th 06 03:35 PM


All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"