答案 0 :(得分:2)
试试这个:
Sub TransposeUnitID()
Dim data As Variant, seq_number As Integer, rw as Long
data = Range("B2:C21").Value '~~>Update as necessary
seq_number = data(1, 2)
rw = 2
For i = 1 To UBound(data)
If data(i, 2) <> seq_number Then
seq_number = data(i, 2)
rw = i + 1
End If
Range("B" & rw).End(xlToRight).Offset(0, 1) = data(i, 1)
Next i
End Sub
注意:
Seq
已订购(例如)Seq
以打印UnitID
以更正单元格