Weird Data Structure - VBA to join to tables ?

opazzo

Board Regular
Joined
Dec 21, 2005
Messages
69
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have two sheets with a common key "CardName".

One sheet has properties (first table below) that I want to copy to the second sheet after the last column of the second table. The first row would be headers and the second row repeated for each item with the same card name.

Properties.PNG

The number of properties columns in the first sheet can vary for each CardName, but the number of rows is always 2.

The number of lines in the second table varies from 1 to nnn for each cardname.
Details.PNG


The intended result would look something like this :

1614783903379.png


I'm looking for VBA suggestions as I would prefer to avoid writing many lookups. I'm also looking into namedranges and tables but cannot identify a good way forward.

Appreciate the inputs.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
this is not normalized data and cannot be used with sql.
it would take lots of programming to fix.
 
Upvote 0
this is not normalized data and cannot be used with sql.
it would take lots of programming to fix.
I see. I can easily transform the first table to get the data vertical in three columns : CardName, Properties, Format.

However the intended result format would still remain the same (data populated in rows).

Would that be a better starting point ? What would you think of to join / lookup and transpose data to the second table ?
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

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