+ Reply to Thread
Results 1 to 3 of 3

using multiple and/or in an if

  1. #1
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    using multiple and/or in an if

    Small part of a macro I'm working on: trying to select if a value is within certain criteria.

    values will be blank or a number. OK numbers are 1-122, 205-211, 216-222, 305-311, 312-322, 401-424.

    can I stack a bunch of or __ and__ arguements like this
    Please Login or Register  to view this content.
    or does each need to be a nested if like
    Please Login or Register  to view this content.
    (I know this isn't right or finished, just a quick thrown together example)

    Or is there a different/better way to do it?
    -Russell

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: using multiple and/or in an if

    Please Login or Register  to view this content.
    Maybe?
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    01-06-2014
    Location
    Columbus, IN
    MS-Off Ver
    2013/O365
    Posts
    41

    Re: using multiple and/or in an if

    yes, that works well. Here's what I ended up with:
    Please Login or Register  to view this content.
    Also switching another messy if to something like this elsewhere in the macro.

    Thanks

+ 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] Counting multiple items with multiple criteria from multiple sheets?
    By essee in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-23-2013, 01:56 AM
  2. Replies: 20
    Last Post: 03-13-2013, 04:15 PM
  3. [SOLVED] Large spreadsheet; multiple scores on multiple dates for multiple students
    By MelindaCapri in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-16-2012, 06:03 PM
  4. Return Multiple Values with multiple rows & multiple columns
    By sachin parab in forum Excel General
    Replies: 2
    Last Post: 11-05-2012, 10:21 AM
  5. Replies: 5
    Last Post: 11-04-2010, 06:02 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