View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
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