+ Reply to Thread
Results 1 to 3 of 3

Is there a way to consolidate 30 spreadsheets into one for data entry?

Hybrid View

  1. #1
    Registered User
    Join Date
    11-22-2010
    Location
    Finland
    MS-Off Ver
    Excel 2003, 2007
    Posts
    95

    Re: Is there a way to consolidate 30 spreadsheets into one for data entry?

    Definitely a place for a macro.

    In my example there is a theoretical max of 50 rows (which was easier to record than with something like 500 rows) in each of the three lines but you can see in the code where to modify when needed.

    So Sheet1 is the master sheet to collect the data and Sheets from 2 to 4 are the information sheets. Information (with blanks in the end) is A1:A50 in every sheet and it's consolidated manually (not with Excel Consolidate feature). I believe the code makes things pretty clear:

    Sub Macro1()
        Sheets("Sheet2").Select
        Range("A1:A50").Select
        Selection.Copy
        Sheets("Sheet1").Select
        Range("A1").Select
        ActiveSheet.Paste
        Sheets("Sheet3").Select
        Range("A1:A50").Select
        Selection.Copy
        Sheets("Sheet1").Select
        Range("A51").Select
        ActiveSheet.Paste
        Sheets("Sheet4").Select
        Range("A1:A50").Select
        Selection.Copy
        Sheets("Sheet1").Select
        Range("A101").Select
        ActiveSheet.Paste
        Range("A1:A150").Select
        Range("A150").Activate
        Selection.SpecialCells(xlCellTypeBlanks).Select
        Application.CutCopyMode = False
        Selection.EntireRow.Delete
        Range("A1").Select
    End Sub

    Indeed I recorded the macro but not wrote it so there might be pointless lines. Shouldn't be though.

    Again: this needs to be expanded from 3 to 30 sheets and the data ranges might need a slight modification.

    ---
    Edit: Amazed by code below
    Last edited by KiPA; 11-24-2010 at 06:44 AM.
    An example file is never useless!

    Tried an example function of mine and got errors?
    - Had you found them, replace ; with , and , with .

+ 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