+ Reply to Thread
Results 1 to 7 of 7

Macro to find/compare data and move data from one sheet to the other

  1. #1
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Macro to find/compare data and move data from one sheet to the other

    I have attached both test sheets... What I am working with is Test1 is an order system sheet we will say... and Test2 is the sheet I get sent daily in an email...
    I need to be able to run a macro on Test2 that will find each order number from it and find the order number in Test1 and place the corresponding Billing Doc # & Price for that Order # in the Test1 sheet... This should be an easy task but I cannot seem to figure out a way to get it working... Thanks for all the input ahead of time!!! Remember the data in TEST2 sheet is always changing and the TEST1 sheet will be a huge list of numbers these are only test sheets...

    Test2.xlsx

    TEST1.xlsx

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

    Re: Macro to find/compare data and move data from one sheet to the other

    Make sure that both workbooks are open. Place the following macro in a regular module in the Test2 workbook and save the file as a macro-enabled file so that the extension is changed to "xlsm". Then run the macro.
    Please Login or Register  to view this content.
    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
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Macro to find/compare data and move data from one sheet to the other

    Why not to use a formula with a VLOOKUP covering a large range.
    Like
    =VLOOKUP(E2,[Test2.xlsx]Sheet1!$B$1:$D$20000,2,0)
    See attached
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Macro to find/compare data and move data from one sheet to the other

    The copydata does not work due to out of range.... Can anyone help me out here..

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

    Re: Macro to find/compare data and move data from one sheet to the other

    Can you post a copy of your file?

  6. #6
    Forum Contributor
    Join Date
    04-14-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    198

    Re: Macro to find/compare data and move data from one sheet to the other

    Ok,

    The copydata works but it only does the column copy/paste if the cells are right next to each other... the actual file they are not next to each other they are cells A & I so that is where I am stuck at now.

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

    Re: Macro to find/compare data and move data from one sheet to the other

    I based the macro on the information you gave in your original post. The macro won't work properly if the organization of the actual data is different. Can you please post copies of both actual files. It would be much easier to 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. How to compare and move data from one sheet to another
    By cgonzo1970 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-28-2014, 07:45 PM
  2. compare data and move it to new sheet
    By savio in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-28-2014, 09:02 PM
  3. Replies: 0
    Last Post: 05-10-2013, 08:08 AM
  4. I need help. Huge data source, I need to clean it up. Find and move data macro.
    By sangreal2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 02:26 PM
  5. [SOLVED] Compare both sheet data and find the difference
    By Barieq in forum Excel General
    Replies: 12
    Last Post: 12-17-2012, 02:03 AM
  6. [SOLVED] How to find data on one sheet and move it to the next available row on another sheet?
    By wesman200098 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-01-2012, 03:53 AM
  7. macro to find numeric data & move it
    By Steve Simons in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-16-2005, 07:05 AM

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