Pls help for vba to tabulate string

rombo

Board Regular
Joined
Aug 18, 2010
Messages
50
Office Version
  1. 2019
Platform
  1. Windows
From below table1 I am trying to extract value as shown below in table 2,

Table1

Subject
Class15Class16Class17Class18Class19Class20Class21
Science1XClarkeXAndreaThomas
Maths2ZYSmithYThomasSmith
Bio2YClarkeXAndreaZSmithX
Science2ClarkeSmithThomasThomasClarkeXY
Maths1SmithAndreaAndreaXSmithYZ
Bio1AndreaThomasClarkeYAndreaZClarke
Music1ThomasZSmithZThomasClarkeAndrea
Piano2
XY

<colgroup><col style="width:48pt" span="8" width="64"> </colgroup><tbody>
</tbody>

Table2

Smith - 'This would be selected based on names available on the table1 data area, its typed mannualy,'
Smith-Class15-Maths1 - 'Smith was the typed value for which it picks first column header and matches with its row valu
Smith-Class16-Science2 - 'Similarly for all available columns these rows will generated
Smith-Class17-Music1
Smith-Class19-Maths1
Smith-Class20-Bio2
Smith-Class21-Maths2
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,203,096
Messages
6,053,510
Members
444,668
Latest member
OneCat

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