Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box Warning
I want to write a macro that will show a warning message box when the user
filling out a form, created in Excel 2003 as a template, trys to close or save the form without modifying the contents of a particular cell that contains text that states that "You must enter a reason in this area" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Message Box Warning
Hi Tio
Open workbook template. Launch VBE and paste the below code within the "ThisWorkbook" object. Post back for any help..Thanks Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) 'Here Range("A1") is assumed as mandatory and Range("A2") the comment field If Trim(Range("A2")) < "" And Trim(Range("A2")) = "You must enter a reason in this area" Then MsgBox "Please fill the comments", vbInformation, "Form name" Cancel = True End If End Sub If this post helps click Yes --------------- Jacob Skaria |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
warning message | Excel Discussion (Misc queries) | |||
How to get rid of the warning message | Setting up and Configuration of Excel | |||
warning message | Excel Discussion (Misc queries) | |||
Warning Message | Excel Worksheet Functions | |||
Pop up warning message! | Excel Programming |