- Sub aaa()
- Dim i&, r&, c&
- If [b8] = "" Then MsgBox "No Data!": Exit Sub
- With Sheets(3)
- For i = 8 To 14
- If Cells(i, 2) = "" Then Exit For
- r = .Columns(1).Find(Cells(i, 2)).Row
- c = .Rows(3).Find(Left(Cells(i, 5), 2)).Column
- .Cells(r, c + 1) = Cells(i, 4)
- .Cells(r, c + 2) = .Cells(r, c) - Cells(i, 4)
- Next i
- End With
- End Sub
复制代码 |