Macro/VBA Paste Data Below the Last Used Row

egarcia7

New Member
Joined
Aug 9, 2016
Messages
17
Hello Everyone,

I have 5 tabs in total in my workbook, when I click on the macro button I want to clear the information from the dashboard and then bring in the information from the other tabs onto the Dashboard tab. So the problem i'm having is when I bring in the information from the second, third and fourth tab it just overlaps each other, or in the case below it just pastes it on the selected cell range. I want the code to search for the last row with information and paste it below that

Tab 1: Dashboard
Tab 2: Brian
Tab 3: Michael
Tab 4: Raul
Tab 5: Rudy

Any help will be appreciated, Thank you in advance.

Code:
Sub Aggergate_to_Master()
'
' Aggergate_to_Master Macro
' This macro will clear the master sheet and copy all the new information that the coordinators have updated.
'
If Not ActiveCell.ListObject Is Nothing Then
    ActiveCell.ListObject.DataBodyRange.Delete
End If
'
        
    Sheets("Brian").Select
        Range("Brian").Select
            Selection.Copy
        Sheets("Dashboard").Select
            Range("A11").Select
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                    :=False, Transpose:=False
    
    Sheets("Michael").Select
        Range("Michael").Select
            Application.CutCopyMode = False
                Selection.Copy
        Sheets("Dashboard").Select
            Range("A23").Select
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                    :=False, Transpose:=False
    
    Sheets("Raul").Select
        Range("Raul").Select
            Application.CutCopyMode = False
                Selection.Copy
        Sheets("Dashboard").Select
            ActiveWindow.SmallScroll Down:=27
                Range("A38").Select
                    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                        :=False, Transpose:=False
    
    Sheets("Rudy").Select
        Range("Rudy").Select
            Application.CutCopyMode = False
                Selection.Copy
        Sheets("Dashboard").Select
            Range("A44").Select
                Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
                    :=False, Transpose:=False
    
    Sheets("Andy").Select
        Range("A10").Select
End Sub
 
Fluff the code above worked perfectly, you're amazing :)

Thank you for your help, your time and your patience.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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