+ Reply to Thread
Results 1 to 4 of 4

Simple IF yields error message

  1. #1
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Simple IF yields error message

    What's wrong with this code?
    Please Login or Register  to view this content.

    I get "Object Variable or With Block Variable Not Set"

    Thanks
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Simple IF yields error message

    Hello ChemistB,

    You need a comparator after Intersect. I assume you mean to exit if the cells do not intersect.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Simple IF yields error message

    Ahhh, duhhh, I knew that. Thanks Leith.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Simple IF yields error message

    Hello ChemistB,

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Simple formula using IF and SUM - yields unexpected error
    By Frankie7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-25-2014, 09:04 PM
  2. Simple code required to show message box on error
    By caabdul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2014, 04:08 PM
  3. Simple saveas code, strange error message.
    By ainnocent1983 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-28-2010, 09:16 AM
  4. Error message in a simple nested formula
    By cfsosa in forum Excel General
    Replies: 2
    Last Post: 08-08-2008, 01:47 PM
  5. [SOLVED] Excel 2007 MS Query prompt yields Syntax error
    By Bruce in forum Excel General
    Replies: 0
    Last Post: 05-26-2006, 06:10 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1