You can do it with Power Query:
fnTransform:
(RemoveTop, KeepTop) =>
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
RemoveTopRows = Table.Skip(Source,RemoveTop),
KeepTopRows = Table.FirstN(RemoveTopRows,KeepTop),
PromoteHeaders = Table.PromoteHeaders(KeepTopRows, [PromoteAllScalars=true]),
Unpivoted = Table.UnpivotOtherColumns(PromoteHeaders, {"Employee"}, "Date", "Value")
in
Unpivoted
Output:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Removed Other Columns" = Table.SelectColumns(Source,{"Column1"}),
#"Added RemoveTop" = Table.AddIndexColumn(#"Removed Other Columns", "RemoveTop", 0, 1),
#"Filtered Employee" = Table.SelectRows(#"Added RemoveTop", each ([Column1] = "Employee")),
#"Removed Column1" = Table.RemoveColumns(#"Filtered Employee",{"Column1"}),
#"Added KeepTop" = Table.AddColumn(#"Removed Column1", "KeepTop", each Table.RowCount(Source) / Table.RowCount(#"Removed Column1")),
Transform = Table.AddColumn(#"Added KeepTop", "Custom", each fnTransform([RemoveTop], [KeepTop])),
CombineOutput = Table.Combine(Transform[Custom]),
#"Pivoted Column" = Table.Pivot(CombineOutput, List.Distinct(CombineOutput[Date]), "Date", "Value")
in
#"Pivoted Column"
Or, with VBA:
Sub TransformData()
Dim wsSrc As Worksheet
Dim wsTgt As Worksheet
Dim l As Long
Dim lRows As Long
Dim lCols As Long
Set wsSrc = Sheet1
Set wsTgt = Worksheets.Add
On Error GoTo Terminate
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
With wsSrc
lRows = Intersect(.UsedRange, .Columns("B")).Cells.Count
lRows = lRows / WorksheetFunction.CountIf(.Columns("B"), "Employee")
lCols = .Cells(2, Columns.Count).End(xlToLeft).Column - 2
l = 2
.Cells(l, 2).Resize(lRows, 1).Copy wsTgt.Cells(1, 2)
Do Until .Cells(l, 2).Value = ""
.Cells(l, 3).Resize(lRows, lCols).Copy _
wsTgt.Cells(1, Columns.Count).End(xlToLeft).Offset(0, 1)
l = l + lRows
Loop
End With
Terminate:
If Err Then
Debug.Print "Error", Err.Number, Err.Description
Err.Clear
End If
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Sample workbooks for both approaches are attached
Bookmarks