+ Reply to Thread
Results 1 to 3 of 3

Find value on two sheets and copy in correct order on master list

  1. #1
    Forum Contributor
    Join Date
    01-25-2013
    Location
    nottingham
    MS-Off Ver
    Excel 2007
    Posts
    128

    Find value on two sheets and copy in correct order on master list

    Hello,

    I have three sheets; a master list, Daniels List and josh's list.

    The data in master list is split in half and placed into Daniel and josh list sheets and are updated daily. Each day, we have to copy and paste the data from each of our lists into the master list. The data is not split exactly in half so it is time consuming copy and pasting the updated data into the master list at the end of every day.

    Attached is a sample of what I need the macro to do. Column A has the correct order which is shown in the master list. I need a macro to find the order number in column A on daniels and joshs sheets and copy and paste values and formatting to the correct row in the master list (by finding the matching order number) - I also wouldn't mind a password on the macro button to keep it secure.

    excelhelpforum.xlsx

    Thank you all for your help

  2. #2
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Find value on two sheets and copy in correct order on master list

    Hi danfullwood,
    .
    . The solution i have done for you is somewhat longer and more complicated then it needs to be because
    .
    . a) It helps me see what is going on
    . b) I am learning by answering these sort of Threads and wanted to try out a new idea.
    .
    . Depending on your feedback i can simplify, modify , correct as necessary.
    . The code appears to work with your sample data, and I expect with no, or minor, modification it should work on bigger files with lots more sheets and data.
    .
    . I assume for now, headings are already there..
    .
    . So , assuming you have this to start with ..

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    2
    3
    order forename surname age
    4
    5
    master list

    ... and for example data similar to what you gave :


    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    2
    3
    order forename surname age
    4
    2
    adam smith
    11
    5
    16
    hayley smith
    25
    6
    3
    hayley smith
    12
    7
    4
    jacob smith
    13
    8
    5
    hayley smith
    14
    9
    17
    jacob smith
    26
    10
    18
    josh smith
    27
    11
    19
    dan smith
    28
    12
    1
    dan smith
    10
    13
    20
    hayley smith
    29
    14
    21
    jacob smith
    30
    15
    daniel

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    2
    3
    order forename surname age
    4
    7
    dan smith
    16
    5
    8
    hayley smith
    17
    6
    10
    josh smith
    19
    7
    11
    hayley smith
    20
    8
    12
    jacob smith
    21
    9
    13
    josh smith
    22
    10
    6
    dan smith
    15
    11
    14
    lewis smith
    23
    12
    15
    dan smith
    24
    13
    22
    josh smith
    31
    14
    9
    jacob smith
    18
    15
    23
    dan smith
    32
    16
    24
    lewis smith
    33
    17
    josh

    ......
    . Then after running the code, ( Given in the next Post ( Post # 3 ) due to Post size limitations ), you achieve this

    Using Excel 2007
    Row\Col
    A
    B
    C
    D
    3
    order forename surname age
    4
    1 dan smith 10
    5
    2 adam smith 11
    6
    3 hayley smith 12
    7
    4 jacob smith 13
    8
    5 hayley smith 14
    9
    6 dan smith 15
    10
    7 dan smith 16
    11
    8 hayley smith 17
    12
    9 jacob smith 18
    13
    10 josh smith 19
    14
    11 hayley smith 20
    15
    12 jacob smith 21
    16
    13 josh smith 22
    17
    14 lewis smith 23
    18
    15 dan smith 24
    19
    16 hayley smith 25
    20
    17 jacob smith 26
    21
    18 josh smith 27
    22
    19 dan smith 28
    23
    20 hayley smith 29
    24
    21 jacob smith 30
    25
    22 josh smith 31
    26
    23 dan smith 32
    27
    24 lewis smith 33
    master list

    ...
    Please let me know how you get on

    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  3. #3
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Find value on two sheets and copy in correct order on master list

    Code for post # 2

    Please Login or Register  to view this content.
    Brief Description of code:

    . – A 1 dimension “Mega” Array is made of size equal to the number of data sheets ( excluding the main sheet )
    . – The Array elements of this Array are themselves Arrays. Each of these Arrays contain the data for a sheet
    . – An output Array is made equal in “row” size to the total number of data rows in all data sheets
    . – The output Array is then filled with its “rows” in the appropriate order.
    . – Finally the output Array is pasted out to the master list in one go.

+ 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] Copy Data from different sheets weekly into a master list with data of the whole year
    By ec4excel in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-12-2014, 10:37 AM
  2. [SOLVED] Copy rows in a master sheet to correct 'secondary' worksheets
    By figaro57 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-09-2013, 10:31 PM
  3. [SOLVED] Copy Data to Master List from Multiple Sheets
    By Jrub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2012, 12:59 PM
  4. [SOLVED] Compare Col A across 2 Sheets in different Workbooks, Copy Matches to MASTER list, H/L NON
    By ali.whitaker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-09-2012, 04:49 AM
  5. [SOLVED] Sort List According to Order in Master List (formula)
    By Filibuster in forum Excel General
    Replies: 5
    Last Post: 05-24-2012, 08:21 PM
  6. Printing Multiple Sheets in correct order.
    By jarvo in forum Excel General
    Replies: 2
    Last Post: 04-03-2006, 04:57 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