Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with simple if statement Lou H[_2_] Excel Worksheet Functions 3 November 7th 08 05:40 PM
Simple IF statement Steve Douglas P2p, MCP Excel Worksheet Functions 4 September 10th 07 12:32 PM
Simple IF statement Connie Martin Excel Worksheet Functions 0 November 30th 06 06:09 PM
Simple IF statement Alok Excel Worksheet Functions 0 November 30th 06 05:51 PM
Simple IF statement Dave F Excel Worksheet Functions 0 November 30th 06 05:49 PM


All times are GMT +1. The time now is 01:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"