Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default 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
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
warning message cufc1210 Excel Discussion (Misc queries) 2 September 30th 09 11:48 PM
How to get rid of the warning message RJ Setting up and Configuration of Excel 2 March 27th 09 05:35 PM
warning message allan Excel Discussion (Misc queries) 2 March 5th 07 03:20 AM
Warning Message MLK Excel Worksheet Functions 2 June 29th 06 11:55 AM
Pop up warning message! canix Excel Programming 1 August 5th 05 07:15 PM


All times are GMT +1. The time now is 02:36 AM.

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

About Us

"It's about Microsoft Excel"