+ Reply to Thread
Results 1 to 5 of 5

Multiple workbooks feeding one master workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    10-10-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    42

    Lightbulb Multiple workbooks feeding one master workbook

    I work for a manufacturing company who produces parts for many clients. We have three separate workbooks for our three major clients that contain all of their in-process orders.

    I'm wondering if there's a way to use formulas to copy info from these three separate workbooks (they have identical columns) and have them fill the "next blank row" when they are pulled in.

    Basically, the sales team members wants to be able to pull up and manipulate their own excel workbooks (each member has one of the top three), but our contract administrator wants to be able to open up one document and view all the current open orders, allowing her to asses priority of parts hitting the floor, being shipped, etc.

    If this can't be done with formulas and requires VBA work, that's fine. The simpler the better, though. A lot of the people who will be using these are not extremely excel literate.

  2. #2
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Multiple workbooks feeding one master workbook

    Ok, where are these going to be stored in relation to one another? one common machine, a network drive, separate machines on the same network..?

    Once that is answered it's actually pretty easy to do. I would suggest either tying the boss-mans (or boss-womans) workbook to the others via a workbook_open auto-run type of macro, or just one they can run via a button/hotkey...depends on their comfort level i guess.

    Do you want it to pull in new stuff or just make the bosses sheet match the other 3 exactly (meaning if the bosses sheet has information not in the other sheets it's removed)?

    There's lots of ways to do it
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  3. #3
    Registered User
    Join Date
    10-10-2011
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Multiple workbooks feeding one master workbook

    Thanks for the reply.

    All of the files will be stored on our server. A hotkey to update sounds great. The less they have to fumble around with the ribbon, the better. haha

    I'd like all of the data on this "parent" file to match the other "children" files exactly. This way the sales team can update their own files and do all the information tracking, and the contract administrator can just review the information, compare it, and make decisions based upon their info.

    Thanks again!

  4. #4
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Multiple workbooks feeding one master workbook

    hmm...try this out. This will combine all the "Sheet1" tabs from the "part books" into one MasterSheet.

    Steps to try out:

    1- download the "Test.zip" attachment to anywhere.
    2- extract the folder "Test".
    3- open the file labeled "MasterSheet_WithMacro" and run the macro.

    This macro will look to a folder named ComponentSheets for the parts...from that folder it will extract everything from the "sheet1" tabs (of each book) and paste those rows to the "sheet1" tab of the MasterSheet.


    Option Explicit
    
    Sub LoopDirectory()
    
    Dim summationBook As Workbook
    Dim i As Long, j As Long
    Dim sourceBook As Workbook
    Dim sourceData As Worksheet
    Dim CurrentFileName As String
    Dim myPath As String, myData As String
    Dim where1 As Range, where2 As Range
    
    'The parts need to be kept in a folder sitting in the same directory as the master sheet
    'and the folder should be names ComponentSheets (or name it whatever you like and change
    'the appropriate line (2 lines down) to match your choice
    myPath = Left(ThisWorkbook.FullName, Len(ThisWorkbook.FullName) - Len(ThisWorkbook.Name))
    myPath = myPath & "ComponentSheets"
    
    'Enter the name of the worksheet that contains the data in the separate books
    'for the exmample books I left the name as "Sheet1"
    myData = "Sheet1"
    
    'Finds the name of the first file of type .xls in the current directory
    CurrentFileName = Dir(myPath & "\*.xls")
    
    'Create a workbook for the recap report
    Set summationBook = ThisWorkbook
    'Clear the summationBook of old data - j marks the end of the collection (on A column).
    
    j = summationBook.Worksheets(myData).Cells(Rows.Count, 1).End(xlUp).Row + 1
    summationBook.Worksheets(myData).Range("A2:AA" & j).ClearContents
    
    Do
        '************************************************************************
        Workbooks.Open (myPath & "\" & CurrentFileName)
        Set sourceBook = Workbooks(CurrentFileName)
        Set sourceData = sourceBook.Worksheets(myData)
            '********************************************************************
            'The sourceData will be combed on the "A" column for rows of information
            'Each row (starting below row 1) will be copied to the next available row
            'in the summary book.
                         
            For i = 2 To sourceData.Cells(Rows.Count, 1).End(xlUp).Row
                
                j = summationBook.Worksheets(myData).Cells(Rows.Count, 1).End(xlUp).Row + 1
                sourceData.Range("A" & i & ":AA" & i).Copy Destination:=summationBook.Worksheets(myData).Range("A" & j)
            
            Next i
            '********************************************************************
        sourceBook.Close
        '************************************************************************
    
    'Calling DIR w/o argument finds the next .xlsx file within the current directory.
    CurrentFileName = Dir()
    Loop While CurrentFileName <> ""
    
    
    End Sub
    Attached Files Attached Files

  5. #5
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Multiple workbooks feeding one master workbook

    I had to make alot of assumptions to give you a book to test give er a shot and let me know what works/don't work.

+ 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