Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If, Then, Else (2000)

    I would like some function to test if anything - including a character string - is in a cell. The std. If, then Else function is meant for numerics only and returns a #Value Error when the cell has text in it. Is there something I can use to return a True (or the value of a 3rd cell) if the test cell has anything in it at all (character or number either one)?? Thanks!

  2. #2
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Dallas, Texas, USA
    Posts
    1,680
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: If, Then, Else (2000)

    Try the IsBlank function in combination with the If. For example:

    <font color=blue>=IF(isBlank(A1),D4,A1)</font color=blue>

    This will check cell A1 and return the contents of A1 if it finds anything; otherwise it will return the contents of cell D4. Also, this will work equally well whether A1 & D4 has numerical values or text.
    - Ricky

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If, Then, Else (2000)

    The following should work:

    <code>
    If ActiveSheet.Range("A1").Value = "" Then
    MsgBox "The Cell is empty.
    Else
    MsgBox "The Cell contains something.
    End If
    </code>
    Legare Coleman

  4. #4
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If, Then, Else (2000)

    Thanks! - I tried the 1st one and it worked fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •