Create lists of columns containing a value

Closed
Report
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
I have a need to populate a column in one sheet with column headings from another sheet that contain a given value. I will illustrate better below.

Sheet 1 contains

A B C
1 2 1
5 5 2
7 6 3
8 9
5



I want a macro (or other technique) to create a second sheet that would read:

1 2 3 4 5 6 7 8 9
A B C A B A B C
C C B
C


So, my second sheet, column 1 would contain the headings for any column in the first sheet that contain the value "1". I hope that is easy enough to follow.

Thanks in advance

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
explain how you got this (or any other column)
1
A
C
C

from the data above. I am not able to figure out the pattern here