Help me with this!

Genos

New Member
Joined
Feb 19, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
My new csv looks like the second table which is just a little sample. However, I would like it to look like this:
ElementComponentAttributeRepairUnitT1_SORCostT1_SORLifeCycleT1_AssetGroups
AdaptationsAdapted Passenger liftAdaptated Passenger Lift PresentHouse, Flat
AdaptationsAdapted Passenger liftAdaptated Passenger Lift Not PresentHouse, Flat
AdaptationsAdapted Passenger liftAdaptated Passenger Lift - renewValue10395.5220House, Flat
AdaptationsGrab railsGrab rails PresentHouse, Flat, Block
AdaptationsGrab railsGrab rails Not PresentHouse, Flat, Block
AdaptationsHoistHoist PresentHouse, Flat
AdaptationsHoistHoist Not PresentHouse, Flat
AdaptationsHoistHoist - renewValue1587.4020House, Flat
AdaptationsLevel Access ShowerLevel Access Shower PresentHouse, Flat
AdaptationsLevel Access ShowerLevel Access Shower Not PresentHouse, Flat
AdaptationsPlatform LiftPlatform Lift PresentHouse, Flat, Block
AdaptationsPlatform LiftPlatform Lift Not PresentHouse, Flat, Block
AdaptationsPlatform LiftPlatform Lift - renewValue10582.6420House, Flat, Block
AdaptationsRamped AccessRamped Access PresentHouse, Flat, Block
AdaptationsRamped AccessRamped Access Not PresentHouse, Flat, Block
AdaptationsStair LiftStair Lift PresentHouse, Flat, Block, Non-Dwelling
AdaptationsStair LiftStair Lift Not PresentHouse, Flat, Block, Non-Dwelling
AdaptationsStair LiftStair Lift - renewValue2116.5320House, Flat, Block, Non-Dwelling
AdaptationsThrough Floor LiftThrough Floor Lift PresentHouse, Flat, Block
AdaptationsThrough Floor LiftThrough Floor Lift Not PresentHouse, Flat, Block
AdaptationsThrough Floor LiftThrough Floor Lift - renewValue12699.1720House, Flat, Block
AdaptationsWet RoomWet Room PresentHouse, Flat, Block
AdaptationsWet RoomWet Room Not PresentHouse, Flat, Block
AdaptationsWheelchair AccessWheelchair Access PresentHouse, Flat, Block
AdaptationsWheelchair AccessWheelchair Access Not PresentHouse, Flat, Block
Balconies and WalkwaysBalcony balustrade typeNot presentHouse, Block, Flat

audit_template_nameaudit_siteaudit_areaaudit_regionTitle Page_Simpro Job No.Title Page_UPRNTitle Page_Site conductedTitle Page_Conducted onTitle Page_Conducted by_Adaptations_Adaptations - Select all that are present_Adaptations_Adaptations - Select all that are present-comment_Adaptations_Adapted Passenger Lift - Date of Install_Adaptations_Adapted Passenger Lift - Lifecycle_Adaptations_Adapted Passenger Lift - Unit of measure to be renewed_Adaptations_Adapted Passenger Lift - Unit of measure to be renewed-comment_Adaptations_Adapted Passenger Lift - Amount to be renewed_Adaptations_Adapted Passenger Lift - Attached image_Adaptations_Grab Rails - Date of Install_Adaptations_Grab Rails - Lifecycle_Adaptations_Grab Rails - Unit of measure to be renewed_Adaptations_Grab Rails - Unit of measure to be renewed-comment_Adaptations_Grab Rails - Amount to be renewed_Adaptations_Grab Rails - Attached image_Adaptations_Hoist - Date of Install_Adaptations_Hoist - Lifecycle_Adaptations_Hoist - Unit of measure to be renewed_Adaptations_Hoist - Unit of measure to be renewed-comment_Adaptations_Hoist - Amount to be renewed_Adaptations_Hoist - Attached image_Adaptations_Level Access Shower - Date of Install_Adaptations_Level Access Shower - Lifecycle_Adaptations_Level Access Shower - Unit of measure to be renewed_Adaptations_Level Access Shower - Unit of measure to be renewed-comment_Adaptations_Level Access Shower - Amount to be renewed_Adaptations_Level Access Shower - Attached image_Adaptations_Platform Lift - Date of Install_Adaptations_Platform Lift - Lifecycle_Adaptations_Platform Lift - Unit of measure to be renewed_Adaptations_Platform Lift - Unit of measure to be renewed-comment_Adaptations_Platform Lift - Amount to be renewed_Adaptations_Platform Lift - Attached image_Adaptations_Ramped Access - Date of Install_Adaptations_Ramped Access - Lifecycle_Adaptations_Ramped Access - Unit of measure to be renewed_Adaptations_Ramped Access - Unit of measure to be renewed-comment_Adaptations_Ramped Access - Amount to be renewed_Adaptations_Ramped Access - Attached image_Adaptations_Stair Lift - Date of Install_Adaptations_Stair Lift - Lifecycle_Adaptations_Stair Lift - Unit of measure to be renewed_Adaptations_Stair Lift - Unit of measure to be renewed-comment_Adaptations_Stair Lift - Amount to be renewed_Adaptations_Stair Lift - Attached image_Adaptations_Through Floor Lift - Date of Install_Adaptations_Through Floor Lift - Lifecycle_Adaptations_Through Floor Lift - Unit of measure to be renewed_Adaptations_Through Floor Lift - Unit of measure to be renewed-comment_Adaptations_Through Floor Lift - Amount to be renewed_Adaptations_Through Floor Lift - Attached image_Adaptations_Wet Room - Date of Install_Adaptations_Wet Room - Lifecycle_Adaptations_Wet Room - Unit of measure to be renewed_Adaptations_Wet Room - Unit of measure to be renewed-comment_Adaptations_Wet Room - Amount to be renewed_Adaptations_Wet Room - Attached image_Adaptations_Wheelchair Access - Date of Install_Adaptations_Wheelchair Access - Lifecycle_Adaptations_Wheelchair Access - Unit of measure to be renewed_Adaptations_Wheelchair Access - Unit of measure to be renewed-comment_Adaptations_Wheelchair Access - Amount to be renewed_Adaptations_Wheelchair Access - Attached image_Balconies and Walkways_Balconies and Walkways - Select all that apply_Balconies and Walkways_Balconies and Walkways - Select all that apply-comment_Balconies and Walkways_Select balustrade type_Balconies and Walkways_Select balustrade type-comment_Balconies and Walkways_Balustrade type - Date of Install_Balconies and Walkways_Balustrade type - Lifecycle_Balconies and Walkways_Balustrade type - Unit of measure to be renewed_Balconies and Walkways_Balustrade type - Unit of measure to be renewed-comment_Balconies and Walkways_Balustrade type - Amount to be renewed_Balconies and Walkways_Balustrade type - Attached image_Balconies and Walkways_Select balcony structure material_Balconies and Walkways_Select balcony structure material-comment_Balconies and Walkways_Balcony Structure - Date of Install_Balconies and Walkways_Balcony Structure - Lifecycle_Balconies and Walkways_Balcony Structure - Unit of measure to be renewed_Balconies and Walkways_Balcony Structure - Unit of measure to be renewed-comment_Balconies and Walkways_Balcony Structure - Amount to be renewed_Balconies and Walkways_Balcony Structure - Attached image_Balconies and Walkways_Select the balcony surface finish_Balconies and Walkways_Select the balcony surface finish-comment_Balconies and Walkways_Balcony Surface Finish - Date of Install_Balconies and Walkways_Balcony Surface Finish - Lifecycle_Balconies and Walkways_Balcony Surface Finish - Unit of measure to be renewed_Balconies and Walkways_Balcony Surface Finish - Unit of measure to be renewed-comment_Balconies and Walkways_Balcony Surface Finish - Amount to be renewed_Balconies and Walkways_Balcony Surface Finish - Attached image_Balconies and Walkways_Select the balcony type_Balconies and Walkways_Select the balcony type -comment_Balconies and Walkways_Balcony Type - Date of Install_Balconies and Walkways_Balcony Type - Lifecycle_Balconies and Walkways_Balcony Type - Unit of measure to be renewed_Balconies and Walkways_Balcony Type - Unit of measure to be renewed-comment_Balconies and Walkways_Balcony Type - Amount to be renewed_Balconies and Walkways_Balcony Type - Attached image_Bathrooms_Bathrooms - Select all that apply_Bathrooms_Bathrooms - Select all that apply-comment_Bathrooms_Select cloakroom/shower room size_Bathrooms_Select cloakroom/shower room size-comment_Bathrooms_Select fittings available in cloakroom/shower room_Bathrooms_Select fittings available in cloakroom/shower room-comment_Bathrooms_Cloakroom/shower room - Date of Install_Bathrooms_Cloakroom/shower room - Lifecycle_Bathrooms_Cloakroom/shower room - Unit of measure to be renewed_Bathrooms_Cloakroom/shower room - Unit of measure to be renewed-comment_Bathrooms_Cloakroom/shower room - Amount to be renewed_Bathrooms_Cloakroom/shower room - Attached image_Bathrooms_Select en-suite bathroom size_Bathrooms_Select en-suite bathroom size-comment_Bathrooms_En-suite bathroom - Date of Install_Bathrooms_En-suite bathroom - Lifecycle_Bathrooms_En-suite bathroom - Unit of measure to be renewed_Bathrooms_En-suite bathroom - Unit of measure to be renewed-comment_Bathrooms_En-suite bathroom - Amount to be renewed_Bathrooms_En-suite bathroom - Attached image_Bathrooms_Select main bathroom size_Bathrooms_Select main bathroom size-comment_Bathrooms_Select fittings available in main bathroom_Bathrooms_Select fittings available in main bathroom-comment_Bathrooms_Main bathroom - Date of Install_Bathrooms_Main bathroom - Lifecycle_Bathrooms_Main bathroom - Unit of measure to be renewed_Bathrooms_Main bathroom - Unit of measure to be renewed-comment_Bathrooms_Main bathroom - Amount to be renewed_Bathrooms_Main bathroom - Attached image_External Doors_External Doors - Select all that apply_External Doors_External Doors - Select all that apply-comment_External Doors_Select the type of front door_External Doors_Select the type of front door-comment_External Doors_External front door - Date of Install_External Doors_External front door - Lifecycle_External Doors_External front door - Unit of measure to be renewed_External Doors_External front door - Unit of measure to be renewed-comment_External Doors_External front door - Amount to be renewed_External Doors_External front door - Attached image_External Doors_Select the type of external door_External Doors_Select the type of external door-comment_External Doors_Other external door - Date of Install_External Doors_Other external door - Lifecycle_External Doors_Other external door - Unit of measure to be renewed_External Doors_Other external door - Unit of measure to be renewed-comment_External Doors_Other external door - Amount to be renewed_External Doors_Other external door - Attached image_Kitchen_Kitchen - Does the kitchen have adequate space and layout_Kitchen_Kitchen - Does the kitchen have adequate space and layout-comment_Kitchen_Kitchen - Select all that apply_Kitchen_Kitchen - Select all that apply-comment_Kitchen_Utility room - Date of Install_Kitchen_Utility room - Lifecycle_Kitchen_Utility room - Unit of measure to be renewed_Kitchen_Utility room - Unit of measure to be renewed-comment_Kitchen_Utility room - Amount to be renewed_Kitchen_Utility room - Attached image_Kitchen_Kitchenette/mini-kitchen - Date of Install_Kitchen_Kitchenette/mini-kitchen - Lifecycle_Kitchen_Kitchenette/mini-kitchen - Unit of measure to be renewed_Kitchen_Kitchenette/mini-kitchen - Unit of measure to be renewed-comment_Kitchen_Kitchenette/mini-kitchen - Amount to be renewed_Kitchen_Kitchenette/mini-kitchen - Attached image_Kitchen_Kitchen installation unconfirmed - Date of Install_Kitchen_Kitchen installation unconfirmed - Lifecycle_Kitchen_Kitchen installation unconfirmed - Unit of measure to be renewed_Kitchen_Kitchen installation unconfirmed - Unit of measure to be renewed-comment_Kitchen_Kitchen installation unconfirmed - Amount to be renewed_Kitchen_Kitchen installation unconfirmed - Attached image_Kitchen_Kitchen FD30 fire door - Date of Install_Kitchen_Kitchen FD30 fire door - Lifecycle_Kitchen_Kitchen FD30 fire door - Unit of measure to be renewed_Kitchen_Kitchen FD30 fire door - Unit of measure to be renewed-comment_Kitchen_Kitchen FD30 fire door - Amount to be renewed_Kitchen_Kitchen FD30 fire door - Attached image_Kitchen_Kitchen-small - Date of Install_Kitchen_Kitchen-small - Lifecycle_Kitchen_Kitchen-small - Unit of measure to be renewed_Kitchen_Kitchen-small - Unit of measure to be renewed-comment_Kitchen_Kitchen-small - Amount to be renewed_Kitchen_Kitchen-small - Attached image_Kitchen_Kitchen-medium - Date of Install_Kitchen_Kitchen-medium - Lifecycle_Kitchen_Kitchen-medium - Unit of measure to be renewed_Kitchen_Kitchen-medium - Unit of measure to be renewed-comment_Kitchen_Kitchen-medium - Amount to be renewed_Kitchen_Kitchen-medium - Attached image_Kitchen_Kitchen-large - Date of Install_Kitchen_Kitchen-large - Lifecycle_Kitchen_Kitchen-large - Unit of measure to be renewed_Kitchen_Kitchen-large - Unit of measure to be renewed-comment_Kitchen_Kitchen-large - Amount to be renewed_Kitchen_Kitchen-large - Attached image_Kitchen_Kitchen-extra large - Date of Install_Kitchen_Kitchen-extra large - Lifecycle_Kitchen_Kitchen-extra large - Amount and Unit to be renewed_Kitchen_Kitchen-extra large - Unit of measure to be renewed_Kitchen_Kitchen-extra large - Unit of measure to be renewed-comment_Kitchen_Kitchen-extra large - Amount to be renewed_Kitchen_Kitchen-extra large - Attached image_Kitchen_Kitchen-DDA adapted - Date of Install_Kitchen_Kitchen-DDA adapted - Lifecycle_Kitchen_Kitchen-DDA adapted - Unit of measure to be renewed_Kitchen_Kitchen-DDA adapted - Unit of measure to be renewed-comment_Kitchen_Kitchen-DDA adapted - Amount to be renewed_Kitchen_Kitchen-DDA adapted - Attached image
Stock Condition - Flat SurveyAssessor Test FRA (Residential) - First SelectPennington ChoicesFire Risk Assessments
76543​
2.11E+08​
2024-02-16T09:18:07.280ZCait GeorgeNon PresentBalcony Type, Balcony BalustradeTimber - Boarded
2003​
30​
Linear meters
1.75​
b05d1a64-de52-42ac-a441-34e8a8a0ddcbJuliette
2003​
35​
Value (£)
1​
56081e83-ace5-4720-b7e0-e7d3ff480df9Cloakroom/Shower room, Main bathroomCloakroom/shower room - Small (<4m2)WC, basin
2003​
30​
Value (£)
1​
765fc386-008c-40bc-9876-eac278cde188Main Bathroom - Medium (4-8m2)Shower over bath, basin, WC
2003​
35​
Value (£)
1​
e90433ca-b8e7-4a50-a260-5bff92594d20Door - Dwelling front door typeDoor - Dwelling front door Other
2003​
50​
Unit
1​
c6158e78-d3f1-42a3-894c-81ad02dedae5Inadequate, improvement not possibleKitchenette/mini-kitchen
2003​
35​
Unit
1​
fca2c679-527b-46a6-8a6d-773b2f2c06fd
Stock Condition - Flat SurveyAssessor Test FRA (Residential) - DirectPennington ChoicesFire Risk Assessments
23456​
7.89E+08​
2024-02-16T09:07:25.944ZCait GeorgeRamped Access, Stair Lift, Non Present, Grab rails
1995​
20​
Value (£)
4​
489688c9-c672-4d15-a233-96282b1b1cd6
2005​
20​
Value (£)
2​
8ae570ff-dc86-4cde-a190-7fd710224c2f
2005​
20​
Value (£)
1​
32d705b7-6887-4a13-87bd-d2a73540f98aNon PresentMain bathroomMain Bathroom - DDA AdaptedDDA Adapted
2005​
35​
Value (£)
1​
c7851c3b-f687-41e1-9429-d92a8a89566bDoor - Dwelling front door type, Door - Other external door typeDoor - Dwelling front door – FD30S Door Set
1999​
45​
Unit
1​
616c7578-97ba-4485-bfe8-b7ebb315a859Door - Other external - uPVC - sliding patio
2000​
45​
Unit
1​
a823567d-5b8f-453e-9585-f66c3060d544AdequateKitchen - DDA adapted, Kitchen FD30 fire door
2005​
35​
Unit
1​
d3164d24-273a-4a9b-ab18-095e97e2011e
2005​
30​
Unit
1​
2da98f92-d498-4152-be07-67398ea9aeb8
Stock Condition - Flat SurveyAssessor Test FRA (Residential)Pennington ChoicesFire Risk Assessments
24681012​
1.36E+10​
2024-02-15T15:37:57.928ZCait GeorgeNon PresentBalcony Balustrade, Balcony Structure, Balcony Surface Finish, Balcony TypeUnconfirmed
2000​
30​
Linear meters
2​
27deef59-d77d-4688-93ee-e6db62a95868Metal
2000​
25​
Unit
1​
3e2700dc-639a-4476-bfa3-685a0af675c2Other
2000​
25​
Square meters
1​
022f7651-9d41-48d6-b0b4-f6c2540933b7Juliette
2000​
25​
Unit
1​
60dc511d-98cb-4bf0-ae4d-f84d6f0c735aMain bathroomMain Bathroom - Small (<4m2)Shower cubicle, basin, WC
2000​
30​
Value (£)
1​
33b7c418-66a1-4753-9efc-985531a9027bDoor - Dwelling front door typeDoor - Dwelling front door uPVC - glazed
2000​
45​
Unit
1​
30076e5f-c3a5-4dcc-b323-145d64da9e03Inadequate storageKitchen - small (less than 7m2)
2000​
40​
Value (£)
1​
02af3a76-7a73-4845-af3a-cf42001752c9
Stock Condition - Flat SurveyTest Site 2, That Rd, Their Town, Somewhere, SW2 3AR - UPRN: SW003506Test Customer (KAT)Fire Risk Assessments
150224​
20240215​
2024-02-15T14:29:01.154ZCait GeorgeAdapted Passenger lift, Level Access Shower, Ramped Access, Through Floor Lift
1990​
20​
Value (£)
1​
23d4250a-fc4e-40d8-b007-a1bae5868428
2000​
20​
Value (£)
1​
5013c08d-90f2-4dfc-95c6-87bb15b7244b
1995​
20​
Value (£)
2​
5c5fd01c-8a5a-409a-8737-2e17e5a4b3f1
2005​
20​
Value (£)
1​
2c7a1bab-2fd4-44d8-862d-066d5724df9bBalcony Balustrade, Balcony Structure, Balcony Surface Finish, Balcony TypeMetal - Glazed
1980​
45​
Linear meters
5​
868256a7-a289-4779-8585-b83545cc9da0Concrete
1980​
45​
Square meters
9​
69f43a2d-eb41-4247-8bd9-3fd8077262efNon slip
1985​
30​
Square meters
3​
18ff7ac4-08c3-45b7-ab73-eddbaf70b553Projecting
1980​
45​
Value (£)
1​
f94d732e-ff11-404a-b84d-ac5fbc0f53b3Cloakroom/Shower room, En-suite batroom, Main bathroomCloakroom/shower room - Medium (4-8m2)WC, basin
1988​
20​
Value (£)
1​
e86af229-14cf-4a66-97a9-b460f8bfdd81En-suite bathroom - Large (>8m2)
1988​
15​
Value (£)
1​
2eb67baa-464f-406a-9b19-c36bea026856Main Bathroom - Large (> 8m2)Bath, shower cubicle, basin, WC
1988​
25​
Value (£)
1​
30e59696-21b2-448b-a0de-f741cb9f90dcDoor - Dwelling front door type, Door - Other external door typeDoor - Dwelling front door uPVC - solid
2000​
10​
Unit
1​
77826420-e086-496d-a4da-90fef43bff7dDoor - Other external - Timber - french
2005​
30​
Unit
1​
a8d2d570-abce-4b94-af50-e1cc1e0c98d2Inadequate - Worktop is not on both sides of the cookerUtility room, Kitchenette/mini-kitchen, Kitchen FD30 fire door
2007​
30​
Value (£)
1​
de8fc8cf-75a2-4a7f-ad62-2cc0fa4e55f3
2009​
35​
Unit
1​
c4e6243e-7b5a-43fa-82a8-35a3927ddc54
2010​
15​
Unit
1​
4eaaf3d1-d08c-458e-8ebe-3fdb2ca325e3
Stock Condition - Flat SurveyTest Site 1, Some Rd, Some Town, Anywhere, AW1 2PB - UPRN: AW004871Test Customer (KAT)Fire Risk Assessments
12345​
9.88E+09​
2024-02-15T12:32:53.740ZCait GeorgeAdapted Passenger lift, Grab rails, Hoist, Level Access Shower, Platform Lift, Ramped Access, Stair Lift, Through Floor Lift, Wet Room, Wheelchair Access
2024​
20​
Value (£)
1​
d51819e5-9272-4ce8-936c-725969970323
2023​
20​
Value (£)
4​
50c487ed-6ea5-4d53-8587-06d802a2d1da
2022​
20​
Value (£)
1​
68cfadbc-b6a2-4802-8919-7f910116209c
2022​
20​
Value (£)
1​
07f70418-bfcb-46da-a113-7b8e8e343149
2021​
20​
Value (£)
1​
8f114438-3c72-42e5-bfd2-6d601e87daa2
2020​
20​
Value (£)
2​
eb979aee-225b-4e27-aa5c-9ad5221a5063, eb3c561b-39d5-4020-ac46-3004bcada4b1
2019​
20​
Value (£)
1​
349f8ad0-8f6a-4315-a29a-b514cd756dbb
2018​
20​
Value (£)
1​
d3b16179-9113-4ecf-aa45-37e27f6d8c85
2017​
20​
Value (£)
1​
1f9f1e4a-0c49-4e7d-a169-e528cf191ea9
2016​
20​
Value (£)
1​
eef24a3d-0bb9-4633-8a8a-ca397e60d71eBalcony Balustrade, Balcony Structure, Balcony Surface Finish, Balcony TypeTimber - Glazed
2015​
30​
Linear meters
4​
cc8589fa-c140-495b-b635-a7e0cf8c9183Concrete
2014​
60​
Square meters
15​
f9b9f916-aa28-419f-bf81-b02c6149dc15Asphalt
2013​
20​
Square meters
8​
9c91a3b5-c4a4-42a9-916d-d8990868cdeaJuliette
2013​
20​
Value (£)
1​
564303a0-074d-43dc-9aea-7d2daa158c0aCloakroom/Shower room, En-suite batroom, Main bathroomCloakroom/shower room - Medium (4-8m2)WC, basin
2011​
30​
Value (£)
1​
515a85d3-823c-42b5-8ac1-ac740d92e85eEn-suite bathroom - Medium (4-8m2)
2010​
20​
Value (£)
1​
5375db32-2b0e-4451-9125-dff0dd3d350aMain Bathroom - Large (> 8m2)Bath, shower cubicle, basin, WC
2009​
30​
Value (£)
1​
7fad3114-59a9-41a6-982e-1a0237381332Door - Dwelling front door type, Door - Other external door typeDoor - Dwelling front door Composite - Glazed
2008​
30​
Unit
1​
1d26dde1-0e33-4d83-bf02-c94048289ca3Door - Other external - Composite - glazed
2007​
35​
Unit
1​
839b2a21-d826-4402-a549-0fd898c3b5e1AdequateUtility room, Kitchen - medium (between 7-9m2)
2006​
20​
Value (£)
1​
cd6a3d4b-b256-499d-bc64-3bf94b44fb34
2006​
20​
Value (£)
1​
d02452e3-2340-44e5-b28c-d8e8332ff7eb

I want the data to be sorted in a similar manner. However, as you can see the columns in the second table are not. Please note this is just a example there are a lot columns but they follow the similar pattern. I am happy to use VBA. If anyone has any suggestions. Thanks!!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hello, here is the code, hope it helps. i've added a lot of commentary in the code itself. the first step you need to do is to copy your second table from above, then paste it to cell A11. After pasting it to cell A11, run the macro below. your example in table1 does not exactly match your data in table2, so it is kind of hard to determine your desired outcome. cheers!

Sub Macro1()
'''you need to copy and paste your sample data to cell A11

'''go to A11
Application.Goto Reference:="R11C1"
''copy cells A11 to XFC16. so, it copies 6 rows. change 6 to 64 or however many rows you have. so, XFC6 becomes XFC64
ActiveCell.Range("A1:XFC6").Select
Selection.Copy


'insert a new sheet, go to A11, paste as transpose
Sheets.Add
Application.Goto Reference:="R11C1"
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True

''your data is pretty messy, it looks like the next step you want is to parse column A.
''instead of parsing column A, let's copy A to AA, so that your original data stays exactly as it was
''if you need to delete columns or move columns later, you can do it manually.

'go to A1, copy to AA1
Application.Goto Reference:="R1C1"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Copy
Application.Goto Reference:="R1C27"
ActiveSheet.Paste
Application.Goto Reference:="R1C27"

''add the letters parse_here in cell aa1 because when the first row is blank during a parsing operation,
'' Excel can sometimes shift the data up one row. not sure why that is, but i've seen it too many times.

Selection.FormulaR1C1 = "'parse_here"

'parse by underscore delimiter
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="_", FieldInfo:=Array(Array(1, 1), Array(2, 1)), TrailingMinusNumbers:=True

''now, it looks like you also need to parse column AC, as it contains a hypen

'add in dummy word parse_here in AC1
Application.Goto Reference:="R1C29"
Selection.FormulaR1C1 = "parse_here"

'''parse by hypen as the delimiter
Application.Goto Reference:="R1C29"
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.TextToColumns Destination:=ActiveCell, DataType:=xlDelimited, TextQualifier:=xlNone, ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar:="-", FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True

''select AA to AP and best fit columns
Application.Goto Reference:="R1C27"
ActiveCell.Columns("A:P").EntireColumn.Select
Selection.Columns.AutoFit
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,571
Members
452,652
Latest member
eduedu

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