Results 1 to 8 of 8

Macro to combine three spreadsheets into 1

Threaded View

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    DallasTX
    MS-Off Ver
    Excel 2007
    Posts
    40

    Macro to combine three spreadsheets into 1

    I have three separate documents that are updated on constant basis by 3 different people.
    Those three documents are linked to a 4th document and will update every hour.
    I need to summarize this information automatically for dashboard purposes.
    I can't use a pivot table because most of the data is text so a pivot table from multiple ranges does not work.
    I wrote a macro to consolidate the data and it works. I can use that data to pivot from there. But I can't repeat that macro.
    I need a way to update that consolidated information. as the the three sheets are updated.

    Macro below: sample workbook attached.
    Thanks for your help!

    Sub Combine()
    Const NHR = 1 'Number of header rows to not copy from each MWS
    
     Dim MWS As Worksheet 'Worksheet to be merged (appended)
     Dim AWS As Worksheet 'Worksheet to which the data are transferred
     Dim FAR As Long 'First available row on AWS
     Dim LR As Long 'Last row on the MWS sheets
    
     Set AWS = ActiveSheet
    
     For Each MWS In ActiveWindow.SelectedSheets
     If Not MWS Is AWS Then
     FAR = AWS.UsedRange.Cells(AWS.UsedRange.Cells.Count).Row + 1
     LR = MWS.UsedRange.Cells(MWS.UsedRange.Cells.Count).Row
     MWS.Range(MWS.Rows(NHR + 1), MWS.Rows(LR)).Copy AWS.Rows(FAR)
     End If
     Next MWS
    
    End Sub
    Moderators note: code tags added for you - this time
    Attached Files Attached Files
    Last edited by joyhampton; 10-02-2013 at 08:05 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Combine two spreadsheets
    By Clash in forum Excel General
    Replies: 3
    Last Post: 09-12-2013, 10:09 AM
  2. [SOLVED] Macro/Formula to Combine Two Spreadsheets -2
    By tgudex in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-19-2012, 06:59 PM
  3. [SOLVED] Macro/Formula to Combine Two Spreadsheets
    By tgudex in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-14-2012, 07:39 PM
  4. Macro to combine spreadsheets
    By souljive99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2009, 10:25 AM
  5. [SOLVED] Combine two spreadsheets using Macro
    By jlogsdon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-23-2005, 07:06 PM

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