Automatically Convert all columns to a named list column based on the first cell data but incorporating all data in the column as part of the named c

jetbluebob

New Member
Joined
Apr 21, 2016
Messages
1
Hello All,

I am trying to put together a spreadsheet that will be, pretty much automated, after importing data from another sheet.

I am currently able to Sort the Data based of the import to other sheets based on the first column data which for this case is City. But the issue I have, is the new data that was sorted out to the different sheets no longer has a Column List Name. Which sorta puts me a stand still... Is there anyway to create a script to autopopulate the current header in the List Name Header for the Column?

[TABLE="width: 668"]
<tbody>[TR]
[TD="align: left"]City[/TD]
[TD="align: left"]CrewID[/TD]
[TD="align: left"]Full Name[/TD]
[TD="align: left"]Email[/TD]
[TD="colspan: 5"]<-- This row 1 - needs to become a Named List Column using VBA so i can use it on the 90 other sheets and it needs to automatically be named based on the Row 1 Value and the length needs to be Dynamic [/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]2341234[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD="colspan: 5"][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]12344123[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]12341234[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]54353[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]5623456[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]23452[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]23452[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]2345[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]3452354[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]2345235[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]234524[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]2345[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]8866[/TD]
[TD]John Smith[/TD]
[TD]John@John.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CITY1[/TD]
[TD]565[/TD]
[TD]John John[/TD]
[TD]john@123.com[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Any help would be greatly appreciated
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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