+ Reply to Thread
Results 1 to 7 of 7

Macro to move data from one worksheet to another based off of criteria;

  1. #1
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Question Macro to move data from one worksheet to another based off of criteria;

    Hello. I am working in a workbook. I have two main worksheets. I have been looking for a code that would remove row information from one worksheet and copy it into another based off of criteria. I am new to VBA, and need a little assistance.


    Example below - If YES is selected in the Deletion column, remove all row information from (#Sheet1) and paste all row information into (#Sheet2). (That would allow formatting to table.)
    Excel.JPG


    Also, is there a way to move column K to column J after Dec 31 of every year with criteria of column a not being of same year? For example for everything that is 2014 or less, move column k to column j every year after December 31?

    I hope this is clear as mud and appreciate any help that can be given to me, a newbie to VBA and coding. Thanks!
    Last edited by KLiving; 09-16-2015 at 05:00 PM. Reason: Spelling Error

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to move data from one worksheet to another based off of criteria;

    This answers your first question. You will need to paste the code in the Visual Basic Editor in the Sheet1 module.

    Please Login or Register  to view this content.

    Your second question
    Also, is there a way to move column K to column J after Dec 31 of every year with criteria of column a not being of same year? For example for everything that is 2014 or less, move column k to column j every year after December 31?
    Is very confusing to me so I am not able to answer it.
    If you are happy with my response please click the * in the lower left of my post.

  3. #3
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to move data from one worksheet to another based off of criteria;

    I copied as instructed to appropriate sheet. I changed "Sheet2" to "Sheet5" and I am getting the message below. Can you explain ".Range("A" & Rows.Count).End(3)(2)"

    Error.JPG

  4. #4
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to move data from one worksheet to another based off of criteria;

    Also, the information is working from a table, if that is of any help

  5. #5
    Forum Contributor
    Join Date
    10-01-2012
    Location
    england
    MS-Off Ver
    Excel 2016 pro
    Posts
    772

    Re: Macro to move data from one worksheet to another based off of criteria;

    hi
    ive usually found that error is it can not find the sheet its supposed to ,try changing back to sheet2
    colin
    Last edited by cfinch100; 09-17-2015 at 11:03 AM.

  6. #6
    Registered User
    Join Date
    10-25-2013
    Location
    Conway, Arkansas
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: Macro to move data from one worksheet to another based off of criteria;

    Asset Book.xlsx

    Attached is the a sample of workbook. I am not sure if it will help. In the assets worksheet, if column N, (Deletion Y/N),=yes, remove from Assets worksheet, and paste in Deleted worksheet.

  7. #7
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to move data from one worksheet to another based off of criteria;

    There isn't a Worksheet named "Sheet2" nor "Sheet5" in your workbook. There is a Worksheet named "Deleted Assets".

    Note: I edited the code to work better on your supplied workbook
    Please Login or Register  to view this content.

+ 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] Macro to Move Rows to New Worksheets Based on Criteria & Then HIDE & Move Back
    By abro0821 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2014, 04:00 PM
  2. [SOLVED] Macro Needed - Move data to worksheet based on criteria
    By sharpyoungb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2014, 11:42 AM
  3. [SOLVED] Move Row to another worksheet based on a Yes No Criteria
    By littleliz02 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-18-2013, 01:09 AM
  4. Move data to specific worksheet based on Column A criteria.
    By forestminuet in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-07-2013, 01:44 PM
  5. Need to move data that matches criteria in cell and move to new worksheet
    By panagle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2013, 09:23 AM
  6. I need to move data from main worksheet into multiple worksheets based on a criteria
    By ksenia81 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2012, 05:45 PM
  7. Macro to copy worksheet data to another worksheet based on criteria
    By excelvb in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2011, 04:11 AM

Tags for this Thread

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