© Matti Mattila, CPFA, CISA, CIA

Join Tables Excel Macro #1 (JoiTab1)

Next item Previous menu

Purpose and functionality of 'JoiTab1'

The macro joins data of two tables (source tables: primary table; secondary table) into a third table (new table).

In the new table there will be all rows of the primary table, and the rows of the secondary table, where the join key value matches that of the primary table. Join key is the column value which the join is based on.

In addition, the macro appends three columns at the end of each line of the new table:
(i) 'PriRow': original row number of the primary table;
(ii) 'SecRow': orignal row number of the secondary table; and
(iii) 'MatCod': code describing the match: '1' = No match in secondary; '3' = Match.

The macro saves information about its run. Path and name of the workbook and worksheet of both source tables, and date and time of the run will be written on the third table, after the three [added] columns mentioned above.

The original tables remain unchanged.

Macro download

You can download demo version of the macro here.

Introduction of a newer version of the macro ('JoiTab2'). can be seen here.

Improved version of this macro is 'JoiTab2'.

JoiTab1

Test Design; starting the macro
02.11.2010
Selection of Primary Table and Key for Join
16.11.2010
Selection of Secondary Table
30.11.2010
The New Table
07.12.2010