Macro to Update Master Table with partial data from Source Table

wiseone

Board Regular
Joined
Mar 14, 2015
Messages
144
Hi All,

New problem I'm trying to get an idea on how to execute with VB.

I have a master table with 100 columns and 5000 rows (Table 1).

I also have a source data table in another workbook which is only 10 columns and 500 rows (TABLE 2) (which have 10 matching column headers to TABLE 1).

Both tables have a column A with unique identifiers, But table 2 may have less of them. For both tables, each column may or may not have data.

Any ideas on how to make a macro which will overwrite the cells in TABLE 1 with data from TABLE 2 with the corresponding data ONLY if the data is different than what is already in TABLE 1 and leave blank if blank?

The Master Table (TABLE1) - Holds a master list of unique identifiers and does not need to call any new identifers in (TABLE 2).

All cells must be values only.

Thanks in Advance!

Example:

MASTER TABLE - TABLE 1:
ABCDEFGH~DC
1aaayes10etc
2bbb20
3cccno10
4dddyes
5eeeno10
6fff
7gggyes50
8hhhno40
9iiiyes

<tbody>
</tbody>


Source Table - TABLE2
ABCDEFGH
1aaa55
2dddno20
3gggno50

<tbody>
</tbody>


RESULT - Updated Master Table (TABLE 1)

ABCDEFGH~DC
1aaayes55etc
2bbb20
3cccno10
4dddno20
5eeeno10
6fff
7gggno50
8hhhno40
9iiiyes

<tbody>
</tbody>
 
Last edited:
I managed to fix this....there was one identifier cell with #Ref! in it causing the error.
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,221,849
Messages
6,162,425
Members
451,765
Latest member
craigvan888

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