Need VBA for consolidation of multiple sheets

Demer

New Member
Joined
May 5, 2021
Messages
19
Office Version
  1. 365
  2. 2019
  3. 2013
Platform
  1. Windows
I need a VBA to consolidate all data from multiple sheets that are from column A to the last row and consolidate it on a master sheet but any time I run the vba I need the master sheet to update or delete and ad a new master sheet.

Thanks
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi Demer,

Absolutely no offense to you, but I usually ignore broad requests like this. Reasons:
* There is no specific question
* There's not enough information, like sheet names, to even start working
* The project is too large to answer in one post
* The user hasn't taken any time to look at thousands of examples and try to work out a solution before posting a question
* No code, no screen shots, or no formula was provided as a starting point

I really want to help you and people like you. Please help us help you.

With all sincerity, Jeff
 
Upvote 0
Here is a good link to posting tips to enhance your chances of getting the best help possible: Guidelines
 
Upvote 0
I know this thread is old but this might help anyone in search for a solution. This isn't your solution but if you can understand the flow of it, by all means, modify it to suit your sheet names and ranges.

VBA Code:
Sub CopyMonthsToMaster()

'Go to month
'Get last used row in colulm A (LR1)
'Copy range "B9:T" & LR1)
'Go to Master Worksheet and get first blank row in colulm A (LR2)
'Paste copied values
'Select cell A1
'Next month in Array

Dim arrSht, i
Dim LR1, LR2 As Long

    Application.ScreenUpdating = False
    
    arrSht = Array("January", "February", "March", "April", "May", "June", "July", _
             "August", "September", "October", "November", "December")
             
    Sheets("Master").Range("A2:T9999").Clear

    For i = LBound(arrSht) To UBound(arrSht)
        Worksheets(arrSht(i)).Select
        With Worksheets(arrSht(i))
            .Unprotect Password:=""
            Application.CutCopyMode = True
            LR1 = Worksheets(arrSht(i)).Range("A" & Rows.Count).End(xlUp).Row
            Worksheets(arrSht(i)).Range("B9:T" & LR1).Copy
            LR2 = Sheets("Master").Range("A9999").End(xlUp).Row + 1
            Sheets("Master").Range("A" & LR2).PasteSpecial Paste:=xlPasteValues, _
            Operation:=xlNone, SkipBlanks:=False, Transpose:=False
            Application.CutCopyMode = False
            .Protect Password:=""
        End With
    Next i

    Sheets("Master").Activate
    Sheets("Master").Range("A1").Select
    Application.ScreenUpdating = True
        
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,046
Messages
6,122,854
Members
449,096
Latest member
Erald

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top