Making cells mandatory to fill in
Ok Dave - Now it works to perfect, I cant save and close it without it
wanting me to fill in the required cells.. What can I do
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim cell As Range
For Each cell In Me.Worksheets("MASTER").Range("d5,g5,j5,e7,m7,g10" )
If IsEmpty(cell.Value) Then
MsgBox "You must fill in cell " & cell.Address
Application.Goto cell
Cancel = True
Exit For
End If
Next cell
End Sub
--
w
"wkmooreh" wrote:
I need help, I am working on an excel expense report templete and want them
to fill in certain cells before they exit. When I copied the thread from
below I keep getting error messages. I dont know if I am putting valoues of
the cells i want filled out in the wrong place or not. This is what it looks
like: it says for each cell in range line is not right...
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim cell As Range
For Each cell In Range(d5, g5, j5, e7, m7, g10)
If IsEmpty(cell.Value) Then
MsgBox "You must fill in cell " & cell.Address
Application.Goto cell
Cancel = True
Exit For
End If
Next cell
End Sub
--
wkmooreh
"abfabrob" wrote:
I am creating an application form where I want users to fill certain cells in
before closing the document.
Does anyone have an idiots guide to doing this, cos I'm not great with excell.
ANY help welcome!!!
|