Macro Question

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a form that I will need co-workers to fill out. I
want to create a button that if pressed will make sure
all the fields are completely filled out? Can a Macro do
that?
 
You can use this John

Dim myrange As Range
Set myrange = Worksheets("Sheet1").Range("A1:A6,C10,D12,G1:G3")
If Application.WorksheetFunction.CountA(myrange) < _
myrange.Cells.Count Then
MsgBox "fill in all cells"
Cancel = True
End If
 
Hi John

I copy this code from a beforeclose event and forgot to delete this line
Cancel = True

Sorry
 
Back
Top