+ Reply to Thread
Results 1 to 7 of 7

Moving rows to a different worksheet based on multiple criteria

  1. #1
    Registered User
    Join Date
    03-01-2016
    Location
    New Jersey
    MS-Off Ver
    2013
    Posts
    47

    Moving rows to a different worksheet based on multiple criteria

    Hi all,

    I am using the following code to move rows from my worksheet if the cell in column K = Complete.

    I need to also move rows if the cell in column K = Cancelled. The following is the code I am using. I'm not great with VBA yet so i am having a problem adding the 2nd criteria of cancelled. Can anyone tell me how to amend my code to include Cancelled as a critreria?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by tfagan1978; 03-23-2017 at 11:35 AM. Reason: adding a sample workbook

  2. #2
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Moving rows to a different worksheet based on multiple criteria

    Hi Tfagan1978

    Are you sure this is the correct code posted. Why not upload a sample workbook.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    03-01-2016
    Location
    New Jersey
    MS-Off Ver
    2013
    Posts
    47

    Re: Moving rows to a different worksheet based on multiple criteria

    Hi Sintek,

    I have posted a sample workbook. The code is definitely the one I am using. I hope this helps.

    Thanks,

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Moving rows to a different worksheet based on multiple criteria

    The easiest fix I can think of is to replace this line:

    Please Login or Register  to view this content.
    With this line:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,261

    Re: Moving rows to a different worksheet based on multiple criteria

    Hi tfagan,

    This looks like an Advanced Filter problem to me, more than a VBA problem. Learn a little about Advanced Filters using a filter of Complete OR Canceled.

    http://www.excel-easy.com/examples/advanced-filter.html
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    03-01-2016
    Location
    New Jersey
    MS-Off Ver
    2013
    Posts
    47

    Re: Moving rows to a different worksheet based on multiple criteria

    This worked perfectly. Thank you

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,287

    Re: Moving rows to a different worksheet based on multiple criteria

    Try this for starters.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. How to copy rows based on multiple criteria from one worksheet to another ?
    By Caster in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2015, 06:27 AM
  2. Moving data from one worksheet to another based on criteria
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-30-2014, 07:53 AM
  3. [SOLVED] Mark or Delete Rows based on Matching Multiple Criteria in another worksheet
    By clearbluez in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2012, 02:38 PM
  4. [SOLVED] Moving rows to a different sheet based on yes/no criteria
    By mpc_2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-25-2012, 06:01 AM
  5. Replies: 6
    Last Post: 11-29-2010, 04:04 AM
  6. Moving rows to separate worksheet if criteria is met
    By lee4clp in forum Excel General
    Replies: 16
    Last Post: 08-11-2010, 12:05 PM

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