REQUIRED DATA IN CERTAIN CELLS
Posted by Dan on January 25, 2002 2:06 AM
Hi, Thanks to Juan Pablo for the coding that I need for this which I have attached below. How do I now assign this code so that when I go to save the workbook the code runs. At the moment nothing happens but the code does work when tested in Visual Basic. If anyone could help I would appreciate.
Private Sub workbook_BeforeSave()
If WorksheetFunction.CountA(Union([B5], [D5])) = 2 Then
'everything ok
Else
Cancel = True
MsgBox "Please check your form, there are fields with missing data."
End If
End Sub