+ Reply to Thread
Results 1 to 4 of 4

Monthly spreadsheet autopopulate master sheet?

  1. #1
    Registered User
    Join Date
    09-17-2015
    Location
    Chicago, IL
    MS-Off Ver
    2013
    Posts
    9

    Monthly spreadsheet autopopulate master sheet?

    pyDataWithoutHeaders()
    Dim sh As Worksheet
    Dim DestSh As Worksheet
    Dim Last As Long
    Dim shLast As Long
    Dim CopyRng As Range
    Dim StartRow As Long

    With Application
    .ScreenUpdating = False
    .EnableEvents = False
    End With

    ' Delete the summary sheet if it exists.
    Application.DisplayAlerts = False
    On Error Resume Next
    ActiveWorkbook.Worksheets("RDBMergeSheet").Delete
    On Error GoTo 0
    Application.DisplayAlerts = True

    ' Add a new summary worksheet.
    Set DestSh = ActiveWorkbook.Worksheets.Add
    DestSh.Name = "RDBMergeSheet"

    ' Fill in the start row.
    StartRow = 2

    ' Loop through all worksheets and copy the data to the
    ' summary worksheet.
    For Each sh In ActiveWorkbook.Worksheets
    If sh.Name <> DestSh.Name Then

    ' Find the last row with data on the summary
    ' and source worksheets.
    Last = LastRow(DestSh)
    shLast = LastRow(sh)

    ' If source worksheet is not empty and if the last
    ' row >= StartRow, copy the range.
    If shLast > 0 And shLast >= StartRow Then
    'Set the range that you want to copy
    Set CopyRng = sh.Range(sh.Rows(StartRow), sh.Rows(shLast))

    ' Test to see whether there are enough rows in the summary
    ' worksheet to copy all the data.
    If Last + CopyRng.Rows.Count > DestSh.Rows.Count
    Attached Files Attached Files
    Last edited by sahsonk; 09-18-2015 at 10:03 AM.

  2. #2
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    846

    Re: Monthly spreadsheet autopopulate master sheet?

    Hi,

    What do you want help with?
    What do you need doing?
    What is wrong?
    You may also get asked to wrap your code in code tags.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: Monthly spreadsheet autopopulate master sheet?

    Please add code tags as per forum rules - Thank you

  4. #4
    Registered User
    Join Date
    09-17-2015
    Location
    Chicago, IL
    MS-Off Ver
    2013
    Posts
    9

    Re: Monthly spreadsheet autopopulate master sheet?

    Dont know how that happened, but...

    I'm trying to have data generated in monthly sheets automatically populate to a master sheet. What would be the best way to go about solving this problem? Please refer to attachment above. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy data from master sheet in workbook to monthly sheets
    By joserborges in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-27-2014, 09:24 PM
  2. Copy multiple monthly worksheets to master sheet
    By Malkier in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-15-2014, 02:00 AM
  3. Autopopulate Different Sheets from a master sheet
    By JamesFletcher in forum Excel General
    Replies: 7
    Last Post: 05-07-2013, 03:12 AM
  4. Autopopulate other data sheets from a master sheet
    By lorinda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2013, 04:04 PM
  5. Replies: 0
    Last Post: 07-20-2012, 04:44 PM
  6. Updating master sheet with monthly results on other sheet within same workbook
    By aghoba in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 09-03-2011, 08:39 PM
  7. Replies: 5
    Last Post: 01-06-2011, 09:29 AM
  8. Autofill a master spreadsheet with monthly data
    By GatorFanDan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2009, 05:43 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