Field control

C

correomaster

Hello!

I have set up an emailable spreadsheet that acts as a form. This "form"
is sent to myself to consolidate the data. Would it be possible for
this form to stop the macro (and subsequently not being emailed) until
certain "compulsary" fields are filled in by the user?

Thanks in advance.

CorreoMaster
 
R

Ron de Bruin

Hi correomaster

You can use the Counta function in VBA to test if all cells have a value in the range

Example for A1, A3 and A5

If Application.WorksheetFunction.CountA(Range("A1,A3,A5")) = 3 Then
'mail code here
Else
MsgBox "Sorry"
End If
 
Top