Excel VBA -Force users to populate custom form cells

  • Thread starter Thread starter tschultz
  • Start date Start date
T

tschultz

Hi,

Is there a way to force users of a custom form to populate require
cells? I am currently using a macro button to send form data b
e-mail. Prior to actual send, the macro verifies the mandatory cell
are popluated. If not, the blank cell is selected to allow entry.
This form will be moving to a terminal server in near futur
eliminating the need for the send button. I still need to verif
manadory cells are populated and allow users to enter data prior t
closing file.

Any suggestions?

Thanks so much
tschult
 
You can use the BeforeClose event procedure to do this. In the
ThisWorkbook code module, use something like

Private Sub Workbook_BeforeClose(Cancel As Boolean)
If cells_are_incomplete Then
Cancel = True
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top