Thread: mandatory field
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default mandatory field

Particular sheet____________
Particular row_____________

Put this in the ThisWorkbook module

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
If Application.CountA(Sheets("sheet9").Range("c2,d2,h 2,j2")) < 4 Then
Cancel = True
MsgBox "Not finished"
End If
End Sub

--
Don Guillett
SalesAid Software

"flow23" wrote in message
...
I have a sheet for user to input data. However filed in column C,D,H and J
are mandatory.
The file shouldnt save if data isnt entered into any of these columns.

any help