How to find common string combination in strings

Rasm

Well-known Member
Joined
Feb 9, 2011
Messages
505
I have 3 columns headers - so each ther own

1) Header1_Device1 (Col A)
2) Header2_Device1 (Col B)
3) Header3_Device1 (Col C)

How can I find the common string combination - essentially I want to write a macro to devide the header into 2 rows instead of one row - then merger the cells for the common part. so my header would now be

Row 1 ---- Device1 (This would be a merged cell)
Row 2 ------ Header1 & header2 & Header3 (This would still be 3 separate columns)
 
PGC01

ok - I have now managed to get myself real confused - I tried to set up an example for you manually - but the logic is inconsistent. So I will try you code - but I think what I am trying to do is nonsense. If I need more help - I will be back - sorry to make you work - when I dont have my thoughts structured.
 
Upvote 0

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I agree, that's a good thing. When things are not clear it's good to stop, step back and rethink the approach.
 
Upvote 0

Forum statistics

Threads
1,225,155
Messages
6,183,211
Members
453,151
Latest member
Lizamaison

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