+ Reply to Thread
Results 1 to 9 of 9

Macro to move certain records to another file given certain criteria

  1. #1
    Registered User
    Join Date
    09-26-2022
    Location
    Philadelphia
    MS-Off Ver
    365
    Posts
    4

    Macro to move certain records to another file given certain criteria

    I am struggling to create macros to:
    1. move all records with "completed" in column D of the "pending" workbook to the first open row of the "completed" workbook
    2. move the record automatically when column D reads "completed"

    I was told the macros below works, but it doesn't work for me- on a macro enabled file and setting... any assistance would be appreciated :-)
    Attached Images Attached Images

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    7,999

    Re: Macro to move certain records to another file given certain criteria

    I think that the question here is if you want to move the rows one at a time after you enter "Completed" in column D, or if you want to move all the rows that have "Completed" in column D all at once. Also, it would be easier to help and test possible solutions if you could attach a copy of your file. Explain in detail what you want to do referring to specific cells, rows, columns and sheets using a few examples from your data (de-sensitized if necessary). See the yellow banner at the top of this page for instructions to attach a file.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    09-26-2022
    Location
    Philadelphia
    MS-Off Ver
    365
    Posts
    4

    Re: Macro to move certain records to another file given certain criteria

    I am trying to create a macro that will automatically move a record from the "pending" worksheet to the first open row of the "completed" worksheet as soon as "completed" is entered into column D of the "pending" worksheet. I have a macro on the "pending" worksheet to initiate the other macro when "completed" is entered into column D of the "pending" worksheet, but whenever I enter ANY data into ANY cell, i get "compile error - Block if without End if"

    Any assistance is appreciated :-)
    Attached Files Attached Files

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

    Re: Macro to move certain records to another file given certain criteria

    Please Login or Register  to view this content.
    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!!!

  5. #5
    Registered User
    Join Date
    09-26-2022
    Location
    Philadelphia
    MS-Off Ver
    365
    Posts
    4

    Re: Macro to move certain records to another file given certain criteria

    thanks - currently I have one macro on the worksheet to trigger the move, then I have a second macro to actually execute the move - which of these macros does yours replace?

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

    Re: Macro to move certain records to another file given certain criteria

    Both.......

  7. #7
    Registered User
    Join Date
    09-26-2022
    Location
    Philadelphia
    MS-Off Ver
    365
    Posts
    4

    Re: Macro to move certain records to another file given certain criteria

    thanks so much! it works perfectly!

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

    Re: Macro to move certain records to another file given certain criteria

    Glad to have contributed...Tx for rep +

  9. #9
    Registered User
    Join Date
    10-26-2022
    Location
    Pune,India
    MS-Off Ver
    365
    Posts
    1

    Re: Macro to move certain records to another file given certain criteria

    Can anyone help me to create a macro based on the below requirements?

    On daily basis I will receive an production file from the production team, the production numbers may change based on the inventory.

    Total employees: 10 and they produce 500 records means I need to pick rows randomly based on the % which.

    For example, if I am receiving the production file which contain 500 rows means I need to allocate certain 50% for above $10k amount or 40% for 7kto 9999k 30% for 5k to 6999k 10% for below 5k for doing an random audit. (% also vary based on the number of auditors). That random pick should cover all the employees present on that.

+ 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. Calling Database Records with certain Criteria , VBA,Macro, or formulas????
    By biddum in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-24-2012, 01:43 PM
  3. Macro to move some records to a new sheet
    By SueWithQuestion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2010, 08:28 AM
  4. Macro to loop across files, move some records
    By SueWithQuestion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2010, 09:33 AM
  5. Macro To Move Records Up A Column
    By mateapot in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2008, 03:40 AM
  6. separate records into a new file according to a criteria
    By Deci in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2008, 01:19 AM
  7. Macro to move info and delete duplicat records
    By Bob Kopp in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-23-2005, 04:10 PM

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