Here is a macro that should do what you want. It assumes the original data starts in A1 and extends down that column. For testing, it writes the results into E1; but if it works OK, you can change that to either overwrite the original, by setting it
A1; or even put it on another worksheet.
I used regular expressions to obtain the different parts of each row (labels and values).
To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this Macro (Sub), <alt-F8> opens the macro dialog box. Select the macro by name, and <RUN>.
======================================
Option Explicit
Sub ParseLabels()
Dim vSrc As Variant
Dim vRes() As Variant
Dim vLabels As Variant
Dim colLabels As Collection
Dim re As Object, mc As Object, m As Object
Dim I As Long, J As Long, lCOL As Long
Dim S As String
Dim rDest As Range
'rDest = destination for results
Set rDest = Range("E1")
'Get Source Data
vSrc = Range("a1", Cells(Rows.Count, "A").End(xlUp))
'Get list of Labels for Column Headers
Set re = CreateObject("vbscript.regexp")
With re
.Global = True
.MultiLine = True
.Pattern = "(?:^|;\s*)([^=]+)"
End With
Set colLabels = New Collection
On Error Resume Next
For I = 1 To UBound(vSrc)
S = vSrc(I, 1)
If re.test(S) = True Then
Set mc = re.Execute(S)
For Each m In mc
colLabels.Add Item:=m.submatches(0), Key:=m.submatches(0)
Next m
End If
Next I
On Error GoTo 0
'sort the labels except first
ReDim vLabels(1 To colLabels.Count)
For I = 2 To colLabels.Count
vLabels(I) = colLabels(I)
Next I
Quick_Sort vLabels, 2, UBound(vLabels)
vLabels(1) = colLabels(1)
'set up results array
ReDim vRes(1 To UBound(vSrc), 1 To UBound(vLabels))
'write column Headers
For I = 1 To UBound(vLabels)
vRes(1, I) = vLabels(I)
Next I
'write data
For I = 2 To UBound(vSrc)
vRes(I, 1) = vSrc(I, 1)
For J = 2 To UBound(vLabels)
re.Pattern = vLabels(J) & "\s*=([^;]+?)\s*(?:;|$)"
If re.test(vSrc(I, 1)) = True Then
Set mc = re.Execute(vSrc(I, 1))
lCOL = WorksheetFunction.Match(vLabels(J), vLabels, 0)
vRes(I, lCOL) = mc(0).submatches(0)
End If
Next J
Next I
Set rDest = rDest.Resize(rowsize:=UBound(vRes), columnsize:=UBound(vRes, 2))
rDest.EntireColumn.Clear
rDest = vRes
rDest.EntireColumn.AutoFit
End Sub
Sub Quick_Sort(ByRef SortArray As Variant, ByVal first As Long, ByVal last As Long)
Dim Low As Long, High As Long
Dim Temp As Variant, List_Separator As Variant
Low = first
High = last
List_Separator = SortArray((first + last) / 2)
Do
Do While (SortArray(Low) < List_Separator)
Low = Low + 1
Loop
Do While (SortArray(High) > List_Separator)
High = High - 1
Loop
If (Low <= High) Then
Temp = SortArray(Low)
SortArray(Low) = SortArray(High)
SortArray(High) = Temp
Low = Low + 1
High = High - 1
End If
Loop While (Low <= High)
If (first < High) Then Quick_Sort SortArray, first, High
If (Low < last) Then Quick_Sort SortArray, Low, last
End Sub
==================================