Need help copy only unique values from multiple tables to next empty row in Master

Daniel_72

New Member
Joined
Jun 26, 2017
Messages
26
Hi all,

I have a workbook with 5 different sheets that all contains Tables named tbl_1, tbl_2, tbl_3 etc. The sheet name that contains tbl_1 is named “1” and so on. All the tables start at A8 with column headings but can vary in nr of columns. I have one sheet named master, also a table.

What I want to do is to copy a specified range in each table (tbl_1 – tbl_5) and paste it to first blank row to the Master table column “A:D”.
I want to do the upload from each table 1 – 5 in different steps, one at a time. The range I want to upload to Master is different in every table. In my example the code check for duplicates in tbl_1 Column (“AA”) and then copy and paste unique values range “AA:AD” to Master table column “A:D”.
I have this code that is working when I do the upload from tbl_1. But when I copied this Macro and adjust the settings for tbl_2 it overwrites the uploaded data from tbl_1. I need the macro to find the next blank row in Master sheet.

Is anyone having an idea on how to adjust the code so it doesn’t overwrites the previous uploaded data? Can someone please help me?

Here is the code:

Sub Upload_tbl_1()
With Sheets("1")
.Range("AB9:AD9", .Cells(Rows.Count, "AA").End(xlUp)).Copy
End With
With Sheets("Master")
.Range("A8:A8").PasteSpecial xlPasteValues
.Range("A8", .Range("A" & Rows.Count).End(xlUp)).RemoveDuplicates 1, xlNo
End With

End Sub


Thanks in advance
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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