+ Reply to Thread
Results 1 to 9 of 9

move data from master list to individual lists based on value in 'Unit' cell

  1. #1
    Registered User
    Join Date
    01-21-2013
    Location
    Nebraska
    MS-Off Ver
    excel 2010
    Posts
    5

    move data from master list to individual lists based on value in 'Unit' cell

    I have a master list of data but I need to copy that data to individual sheets based on the column for 'Unit' . I have a macro in place to sort any new data on the sheets into numerical order by room assignment. I am not sure if an if/then statement is what I need or not. If a person is assigned to a cot they will not have a room number. There may be more than one person to a room at times also. If anyone can help me with this it would be greatly appreciated. This is all mushed up in the preview so the headings are: room #, last name, first name, number, cot, unit & count




    this is basically what the MASTER LIST looks like

    room # last name first name number cot unit count
    1 smith john 12345 1 1
    0 jones steve 12234 A 3 1


    this is basically what the UNIT LIST looks like

    Room # Last Name First Name Number Cot Unit Count
    0 KEITH JACOB 123456 Cot A 2 1
    0 BERGH BRADLEY 123456 Cot T 2 1
    1 STEWS JAMES 123456 2 1
    1 KENNEY KALYN 123456 2 1
    2 HANNA MARK 123456 2 1
    2 MCKINLY ROGER 123456 2 1

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: move data from master list to individual lists based on value in 'Unit' cell

    It will be good if you upload a sample file showing what data you have and how you want the output to look like. You do not need to upload your original file, just a mock-up of the original as long as its in the same format as the original.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    01-21-2013
    Location
    Nebraska
    MS-Off Ver
    excel 2010
    Posts
    5

    Re: move data from master list to individual lists based on value in 'Unit' cell

    Here is an example. Sorry I didn't have it on the computer I began this thread on.
    Attached Files Attached Files

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: move data from master list to individual lists based on value in 'Unit' cell

    Couple of questions -

    In the Unit column you have numbers like 1,2,3 while your sheets are named as HU1, HU2, etc. So should the entries with units as 1 go into HU1, 2 into HU2, etc?

    If you populate the data in your Master sheet and run the macro, it will populate the sheets. Now, if you have new data and want to populate the master sheet, will you copy the data to the next available row in the master sheet or will you clear the sheet and then update?

  5. #5
    Registered User
    Join Date
    01-21-2013
    Location
    Nebraska
    MS-Off Ver
    excel 2010
    Posts
    5

    Re: move data from master list to individual lists based on value in 'Unit' cell

    The 1,2 &3 do correlate to HU's. I would add new data to the next available line in the master. Info will only be transfered out from the master not in to it. The info on the master will be directly added there.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: move data from master list to individual lists based on value in 'Unit' cell

    I understand. The reason i asked you was - if you run the macro the first time and then update data into the master and run again, its going to give you duplicate info in the various sheets. So i have to ask the macro to first clear the contents of the other sheets and then populate the data starting from the 1st row of the master file.

  7. #7
    Registered User
    Join Date
    01-21-2013
    Location
    Nebraska
    MS-Off Ver
    excel 2010
    Posts
    5

    Re: move data from master list to individual lists based on value in 'Unit' cell

    Ok. I see what you mean.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: move data from master list to individual lists based on value in 'Unit' cell

    Try this code - Ensure that the sheet HU 1 is changed to HU1 before running the macro - the sheet names should be consistent, otherwise the macro will give errors.
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  9. #9
    Registered User
    Join Date
    01-21-2013
    Location
    Nebraska
    MS-Off Ver
    excel 2010
    Posts
    5

    Re: move data from master list to individual lists based on value in 'Unit' cell

    my project is at work. I will try this tomorrow. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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