PDA

View Full Version : [SOLVED:] Lookup Values from List and Copy data unde headings VBA



podder
07-15-2022, 10:23 PM
Hi,
I am looking for a VBA solution to the following:
I have a number of headings:
Red Blue Green Yellow

I then have a list of two columns that abbreviates each one as follows:
Re Red
Bl Blue
Gr Green
Yl Yellow

When I get new data it comes in the form of 2 columns as shown below:
20 Yl
10 Re
12 Bl
8 Gr
15 Gr
15 Bl
6 Ye
14 Re

I currently have a spreadsheet setup, using formulas where the given values are distributed under their appropriate headings as shown below:
Red Blue Green Yellow
10 12 8 20
14 15 25 6

Is it possible to obtain the same outcome using VBA.

Thanks

Aussiebear
07-15-2022, 11:32 PM
"Ye" equals.... Typo?

podder
07-15-2022, 11:52 PM
"Ye" equals.... Typo?
Yes
Sorry, my apologies

georgiboy
07-18-2022, 12:51 AM
Couple of options on the attached

Aussiebear
07-18-2022, 03:19 AM
Very clever Georgiboy

podder
07-19-2022, 03:05 AM
Couple of options on the attached

Georgiboy,
Your solution works, but my colour list is longer than what I showed, which is why I wanted it related to a list (my 2 column list in original post).
So I was hoping that the abbreviated entries could be matched with the list. My required final output is what your solution achieves.

Thanks

georgiboy
07-19-2022, 04:44 AM
Another option using filter

podder
07-20-2022, 06:14 PM
Another option using filter

Georgiboy,
Thats perfect, Thankyou