G
Guest
Hi, I'm a Newb
I have used code (see below) I found at this site, which requires certain fields to be completed before you are allowed to exit the form. The code works fantastic except...
I can't exit the template and leave the fields blank for the end user to complete. Also what if the end user has changed his mind and just wants to exit
Would appreciate any and all help
Private Sub Workbook_BeforeClose(Cancel As Boolean
Dim myrange As Rang
Set myrange = Worksheets("Sheet1").Range("A1:A6,B10,D12,G1:G3"
If Application.WorksheetFunction.CountA(myrange) <
myrange.Cells.Count The
MsgBox "All Yellow Highlited Fields Must be Completed
Cancel = Tru
End I
End Su
~dawn
I have used code (see below) I found at this site, which requires certain fields to be completed before you are allowed to exit the form. The code works fantastic except...
I can't exit the template and leave the fields blank for the end user to complete. Also what if the end user has changed his mind and just wants to exit
Would appreciate any and all help
Private Sub Workbook_BeforeClose(Cancel As Boolean
Dim myrange As Rang
Set myrange = Worksheets("Sheet1").Range("A1:A6,B10,D12,G1:G3"
If Application.WorksheetFunction.CountA(myrange) <
myrange.Cells.Count The
MsgBox "All Yellow Highlited Fields Must be Completed
Cancel = Tru
End I
End Su
~dawn