+ Reply to Thread
Results 1 to 14 of 14

Macro Multi Sheet Duplicate Copy to New Sheet

  1. #1
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Macro Multi Sheet Duplicate Copy to New Sheet

    I am trying to copy Duplicates rows from sheet Master column F and sheet Incoming column F, into sheet Duplicates. The data in column F is numbers. This is code that I had found on this site during a preivous search. Excel 2010

    This is what I have so far and well it is broke, the result is Excel has to be forced closed.

    Please Login or Register  to view this content.
    Thank you in advance for your assistance and guidance.

    DW

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Please Login or Register  to view this content.
    ??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    I do not have a clue. I am starting to learn VBA on the fly. I had found the code on this site earlier (wish I would have saved the page).
    Where I am trying to go with all of this. Is that what is left is Master is items that have been removed, while the items left in Import are new items. The Duplicate sheet will only contain one copy of the duplicate not both rows from Master and Import. I want to copy the left over rows from Master into a sheet called Removed. I want to copy the left over rows in Import to a sheet called New Items where I will perform some more manipulation to them ie. assigning department ect. Count up the rows from master that were removed and record that number in a sheet called Tracking with date stamp. Doing the same for Import. Wiping clean Master and Import. Copy Duplicates (should be unique values) and Import back to master and wipe duplicates and Import.

    I hope this helps as I am as lost as can be at this point. Getting the import to work was easy, removing the temporary file that was download after import was easy. I just do not know how to proceed from here. Your help is greatly appreciated and I hope that I can learn from all of this.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Hey DW,

    I meant that you should change that line and try it

  5. #5
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Let me give it a try. Will get back with you.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Hey DW,

    Correction - Change both of those lines!

  7. #7
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Ok made the change. Still locks up excel. If I step threw the the code. in the third (Dup Sheet) in cell F2 it puts the first sheet f2, if we continue to step threw it just over wrights with f3, f4, ect. I have attached an example now that I am not at work.

    example.xlsm

  8. #8
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Missed your post. Changing the second one does not help.

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    This works:

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    It works great. I tried putting in
    Please Login or Register  to view this content.
    after
    Please Login or Register  to view this content.
    To remove the rows from the first two sheets. Odd resuslts. it removed every other row in the fist two sheets and added every other row to the third. How would one go about doing it.

  11. #11
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Something like this:

    Please Login or Register  to view this content.
    Let me know if it works - the problem is that when you're using For Each...Next - you can't delete anything during the process - and it's practically impossible to index the deletions in ascending mode - everyone always deletes descending after it's all over

    Here's a better way - I hope:

    Please Login or Register  to view this content.
    Last edited by xladept; 10-25-2013 at 03:55 PM.

  12. #12
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    The first one was a bust.
    The second one works almost. I just ran it on a copy of my live system 600 records per sheet. I ened up with 3 rows that where not copied over to Duplicates and left in Master sheet and Incoming.
    Thank you DW

    EDIT Figured out the Issue. During export of the imcomming data. The data in column F is stored as number as txt. Is there a way to convert column from number stored at txt to just a normal number, decimal places of 0. The first Duplicate is not moved into Duplicates and not removed from master and Import.

    Thanks again DW.
    Last edited by Digital_Warrior; 10-29-2013 at 11:13 AM. Reason: Issue progression

  13. #13
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Maybe:

    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    10-23-2013
    Location
    Earth
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Macro Multi Sheet Duplicate Copy to New Sheet

    Sorry got pulled into diffrent project for a bit.
    With the Chage to IF C*1 = A*1 I recive a Run-time error 13 Type mismatch.

    I know this has been a pain for you. Thank you for your help.

+ 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. excel macro to copy data from multi text files in a folder to a single work sheet
    By dil_se in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2012, 08:10 AM
  2. Need a Macro that will duplicate a spreadsheet, then copy data from cells into new sheet
    By missmea2005 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-29-2012, 02:06 PM
  3. Replies: 4
    Last Post: 07-24-2012, 07:09 AM
  4. Multi-sheet Duplicate/Exclusive question
    By dkrig in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2011, 06:28 PM
  5. Replies: 2
    Last Post: 04-18-2005, 09:06 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