+ Reply to Thread
Results 1 to 5 of 5

need help with AND statement

  1. #1
    Forum Contributor
    Join Date
    09-19-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    137

    need help with AND statement

    Hello all,

    Can someone please tell me what I'm doing wrong in this AND statement?
    Please Login or Register  to view this content.
    it returns "type mismatch"

    Thanks in advance,

    Willardio

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: need help with AND statement

    the second if clause is a range and not an specific value so I would retype it

    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: need help with AND statement

    As rcm has said, you're comparing a range to a null string.

    You could try:

    Please Login or Register  to view this content.

    or, more specifically:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    09-19-2012
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    137

    Re: need help with AND statement

    Thanks both of you, I went TMShuks' "Dim awf" solution, because it was new and interesting to me, plus I've had difficulties with getting multiple 'And' and 'Or' statements to consider more than the first couple of conditions in the past... I don't know why, it must have been something I did wrong.

    but this is working perfectly, so thanks again!

    Best Regards,

    Willardio

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,446

    Re: need help with AND statement

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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