Simple If Blank Statement

  • Thread starter Thread starter bobwilson
  • Start date Start date
B

bobwilson

This should be a simple if Statement. I want the below error message t
come up if cell A1 is blank. Otherwise(Else) populate data (I hav
excelued the balance of the code.)

namecl = ActiveSheet.Range("A1")

With ActiveSheet
If namecl = "" Then

msg = "Blank Entry. Cannot add Blank contact."
MsgBox msg, vbCritical, "Add New Contact"

Els
 
Set namecl = ActiveSheet.Range("A1")

With ActiveSheet
If namecl.Value = "" Then

msg = "Blank Entry. Cannot add Blank contact."
MsgBox msg, vbCritical, "Add New Contact"

Else


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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