Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Blue Springs, Missouri, USA
    Posts
    108
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Checking for cell value #N/A (XL97)

    I have some code that I want to use to check for the value of #N/A in a cell... it is...

    If ActiveCell.Value = "#N/A" Then

    However... I keep getting a "type mismatch" when I try to run it. And yes, the cell valus is #N/A.

    I have even tried...

    If ActiveCell.Value = "N/A" Then

    To no avail. Any help in pointing me in the right direction would be greatly appreciated.

    Dennis

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Checking for cell value #N/A (XL97)

    Hi,
    Try:
    If Application.WorksheetFunction.isna(activecell.Valu e) = True Then
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Checking for cell value #N/A (XL97)

    Although Rory's suggestion will work, an alternative might be

    If ActiveCell.Text = "#NA" Then

    Andrew C

Posting Permissions

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