+ Reply to Thread
Results 1 to 6 of 6

VBA to copy data from multiple workbooks to Master Workbook

  1. #1
    Registered User
    Join Date
    02-13-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    35

    VBA to copy data from multiple workbooks to Master Workbook

    I have 4 workbooks which each contain a sales log. 1 is a Master Log and 3 are maintained by separate users. I am looking for the easiest way to update the Master Log with the data from the other 3 workbooks that is fast, user friendly and avoids data being corrupted by the users.

    Process:-

    On running Macro open alert with information - ok / cancel
    Go to "Sales Log" unprotect sheet, show all, clear all filters, sort Range ("B3:B100") ascending
    Open Sales Person 1 Workbook, go to 'Sales Log", unprotect sheet
    Select "Range1" sort by ("B3:B100") Copy "Range1"
    Paste Range1 data (values only) in Master Log Range1
    SaveAs Sales Person 1 [date and time] .xlsm and Close [no alerts]
    Repeat for Sales Person 2 and 3 Workbook
    Master Log: Select "RangeALL" sort by ("H3:H100")
    SaveAs Master Log [date and time] .xlsm and Close [no alerts] Attributes: Read Only
    Close excel application

    Please Login or Register  to view this content.
    Last edited by wotsup; 02-23-2012 at 09:24 AM.

  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: VBA to copy data from multiple workbooks to Master Workbook

    Hey Wotsup - Please put your code within code tags (as per forum rules)
    Also, you have not explained anything here. Since i have worked with you on a similar thread, i know the requirement, but others will not. Please explain what you require.
    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
    02-13-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: VBA to copy data from multiple workbooks to Master Workbook

    Thanks Arlette

  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: VBA to copy data from multiple workbooks to Master Workbook

    All code changes given in bold.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-13-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    35

    Re: VBA to copy data from multiple workbooks to Master Workbook

    Hi Arlette... this code is now not calling up the other files. It sorts the master then re-opens it. None of the other files are opened. Can you take another look please?

  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: VBA to copy data from multiple workbooks to Master Workbook

    Do you have a file that you can upload so i can test it? Otherwise, its a lil difficult to find out the bugs.

+ 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