用VBA来做吧:
假设原表为Sheet1,目标为Sheet2。
Sub Test()
ljh = ""
n = 1
For i = 2 To Sheet1.Range("A65536").End(xlUp).Row
If Sheet1.Cells(i, "A") <> "" Then
ljh = Cells(i, "A")
c = 1
n = n + 1
Else
c = c + 1
End If
If Sheet2.Cells(1, c * 2) = "" Then Sheet2.Cells(1, c * 2) = "工序"
If Sheet2.Cells(1, c * 2 + 1) = "" Then Sheet2.Cells(1, c * 2 + 1) = "时间"
If Sheet2.Cells(n, 1) = "" Then Sheet2.Cells(n, 1) = ljh
Sheet2.Cells(n, c * 2) = Sheet1.Cells(i, "B")
Sheet2.Cells(n, c * 2 + 1) = Sheet1.Cells(i, "C")
Next
End Sub