Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: If Statement

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'm sure this must have been asked before but I've done a quick search of the forum and couldn't find what I wanted. I need the code for finding out if cell A1 contains a "Y" and if it does then insert a chart. I have the code for inserting a chart but not too sure on the code for checking if "A1" contains "Y" and if it does how to link it to the add chart code. Hope this makes sense and someone can help.

    thanks

    Matt

  2. #2
    Guest

    Default

    can't help with code, but is this any help? =IF(ISERROR(SEARCH("y",A1)),FALSE,TRUE) will return TRUE if there's a y in the target cell and FALSE if there isn't.

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,584
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Matt

    You could try something like this:

    If Range("A1").Value = "Y" Then Application.Run "name of your chart macro"
    End Sub

    (this is case sensitive)

    hope this helps
    regards
    Derek

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    England
    Posts
    212
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for your help guys!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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