|
如何截图与附件!请各位路过的大师帮帮忙,以下是自己录制的代码!
Sub 备份()
N = Range("B1:B" & Range("B65536").End(3).Row)
For i = 1 To UBound(N)
Cells(i, 20) = Cells(i, 18)
If Cells(i, 1) <> 0 Then Cells(i, 20) = Cells(i - 1, 20)
Cells(i, 21) = Cells(i, 18)
If Cells(i, 1) <> 0 Then Cells(i, 21) = Cells(i - 1, 21)
Cells(i, 22) = Cells(i, 16)
If Cells(i, 1) <> 0 Then Cells(i, 22) = Cells(i - 1, 22)
Cells(i, 23) = Cells(i, 18)
If Cells(i, 1) <> 0 Then Cells(i, 23) = Cells(i - 1, 23)
Cells(i, 24) = Cells(i, 18)
If Cells(i, 1) <> 0 Then Cells(i, 24) = Cells(i - 1, 24)
Next
N = Range("B1:B" & Range("B65536").End(3).Row)
For i = 1 To UBound(N)
Cells(i, 20) = Cells(i, 13) / Cells(i, 20)
Cells(i, 21) = Cells(i, 14) / Cells(i, 21)
If Cells(i, 21) = 0 Then Cells(i, 21) = Empty
Cells(i, 22) = Cells(i, 15) / Cells(i, 22)
If Cells(i, 22) = 0 Then Cells(i, 22) = Empty
Cells(i, 23) = Cells(i, 16) / Cells(i, 23)
If Cells(i, 23) = 0 Then Cells(i, 23) = Empty
Cells(i, 24) = Cells(i, 17) / Cells(i, 24)
If Cells(i, 24) = 0 Then Cells(i, 24) = Empty
Next
For e = 0 To UBound(ttitle)
ttitle = Split("材料占比, 人工占比, 制费占比, 辅材占比, 外协占比")
Cells(1, 20 + e) = ttitle(e)
Next
End Sub
|
|