Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple If Blank Statement
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 -- bobwilso ----------------------------------------------------------------------- bobwilson's Profile: http://www.excelforum.com/member.php...fo&userid=3304 View this thread: http://www.excelforum.com/showthread.php?threadid=52968 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple If Blank Statement
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) "bobwilson" wrote in message ... This should be a simple if Statement. I want the below error message to come up if cell A1 is blank. Otherwise(Else) populate data (I have 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" Else -- bobwilson ------------------------------------------------------------------------ bobwilson's Profile: http://www.excelforum.com/member.php...o&userid=33046 View this thread: http://www.excelforum.com/showthread...hreadid=529682 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple If Blank Statement
Try
If Len(Trim(namecl)) = 0 Then "bobwilson" wrote: This should be a simple if Statement. I want the below error message to come up if cell A1 is blank. Otherwise(Else) populate data (I have 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" Else -- bobwilson ------------------------------------------------------------------------ bobwilson's Profile: http://www.excelforum.com/member.php...o&userid=33046 View this thread: http://www.excelforum.com/showthread...hreadid=529682 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with simple if statement | Excel Worksheet Functions | |||
Simple IF statement | Excel Worksheet Functions | |||
Simple IF statement | Excel Worksheet Functions | |||
Simple IF statement | Excel Worksheet Functions | |||
Simple IF statement | Excel Worksheet Functions |