liuweivvid 发表于 2016-9-18 17:53 
可惜VBA没有接触过...不知道对这个有没有针对性的教程?
给你一个VBA 代码 我测试了 可以
Sub loopin()
Dim a, b, c, i, k, m As Double
Dim countR As Double
Dim countC As Double
Dim ws As Worksheet
Application.DisplayAlerts = False
Application.ScreenUpdating = False
Set ws = ActiveSheet
countR = ws.Range("A1").CurrentRegion.Rows.Count
'MsgBox countR
c = CInt(InputBox("除timestamp外有多少列要复制"))
For i = 1 To countR
If ws.Cells(i, 1).Value <> ws.Cells(i + 1, 1).Value Then
b = i + 1
m = 0
ElseIf ws.Cells(i, 1).Value = ws.Cells(i + 1, 1).Value Then
m = m + 1
a = i + 1
For k = 1 To c
ws.Cells(b, (c * m + 1 + k)).Value = ws.Cells(a, k + 1).Value
Next
End If
Next
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "完成"
End Sub