刚帮boss写的一个excel宏

标签:无

就是转换下格式而已。
其实700多行记录,手动转换也不用多久,学习和编写却花了1个小时…
Sub test()
Dim Row1 As Integer
Row1 = 1
For row2 = 1 To 741
If Left(Sheet2.Cells(row2, 1), 6) = "Serial" Then
Cells(Row1, 1) = Mid(Sheet2.Cells(row2, 1), 11, 7)
Cells(Row1, 2) = RTrim(Mid(Sheet2.Cells(row2, 1), 28, 40))
Cells(Row1, 2) = Left(Cells(Row1, 2), Len(Cells(Row1, 2)) - 1)
ElseIf IsEmpty(Sheet2.Cells(row2, 1)) And IsNumeric(Sheet2.Cells(row2, 7)) Then
Cells(Row1, 3) = Sheet2.Cells(row2, 7)
Cells(Row1, 4) = Sheet2.Cells(row2, 14)
Cells(Row1, 5) = Cells(Row1, 4) / Cells(Row1, 3)
Row1 = Row1 + 1
row2 = row2 + 2
End If
Next row2
End Sub

1条评论 你不来一发么↓ 顺序排列 倒序排列

    向下滚动可载入更多评论,或者点这里禁止自动加载

    想说点什么呢?