ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Validate before running macro (https://www.excelbanter.com/excel-worksheet-functions/95508-re-validate-before-running-macro.html)

ChrisMattock

Validate before running macro
 

Hi all,

Have an issue.... I have a spreadsheet that on running a macro opens a
word document and fills in bookmarks with info from cells. But if the
buuton is clicked when a cell is empty the I want the macro to abort
and put up an error message, could someone tell me how to do this?
Thanks!


--
ChrisMattock
------------------------------------------------------------------------
ChrisMattock's Profile: http://www.excelforum.com/member.php...o&userid=33912
View this thread: http://www.excelforum.com/showthread...hreadid=554511


Toppers

Validate before running macro
 
Something like .... ?

If isempty(yourcell) then
Msgbox "Run aborted"
exit sub
End if

"ChrisMattock" wrote:


Hi all,

Have an issue.... I have a spreadsheet that on running a macro opens a
word document and fills in bookmarks with info from cells. But if the
buuton is clicked when a cell is empty the I want the macro to abort
and put up an error message, could someone tell me how to do this?
Thanks!


--
ChrisMattock
------------------------------------------------------------------------
ChrisMattock's Profile: http://www.excelforum.com/member.php...o&userid=33912
View this thread: http://www.excelforum.com/showthread...hreadid=554511




All times are GMT +1. The time now is 04:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com