+ Reply to Thread
Results 1 to 4 of 4

If/And/OR

  1. #1
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    If/And/OR

    How do I write the code below so it works? Currently it deletes all the "B's" in the column when it should only delete 1 or 2 "B"s" that fit the condition. If I write the code one condition at a time without the "or's" in separate macros that call each other it works but that would be a lot of writing.



    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    12-30-2021
    Location
    Mount Gambier, Australia
    MS-Off Ver
    19
    Posts
    108

    Re: If/And/OR

    Can you upload a file with some data

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: If/And/OR

    Group the conditions for the three tested cells in a given row.

    Group conditions with parenthesis like this...
    Please Login or Register  to view this content.
    Or group conditions with nested IFs like this...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 01-20-2022 at 01:07 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Forum Contributor
    Join Date
    03-16-2004
    MS-Off Ver
    2016
    Posts
    175

    Re: If/And/OR

    Thanks Alpha! Good tip on the grouping.

+ 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