|
1
sub 计算()
Dim ws As Worksheet
Set ws = Worksheets("TANK TABLE")
ws.Unprotect Password:="`111111"
Worksheets("TANK TABLE").Cells(9, 6).Value = Worksheets("1P").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(10, 6).Value = Worksheets("1S").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(11, 6).Value = Worksheets("2P").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(12, 6).Value = Worksheets("2S").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(13, 6).Value = Worksheets("3S").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(14, 6).Value = Worksheets("3P").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(15, 6).Value = Worksheets("OVFL").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(23, 6).Value = Worksheets("DOP").Cells(33, 2).Value
Worksheets("TANK TABLE").Cells(24, 6).Value = Worksheets("DOS").Cells(33, 2).Value
Worksheets("TANK TABLE").Range("I9").Formula = "=IF(G9=0,0,INDEX('TABLE 54B'!A$1:W$105,H9+5,100*ROUND(G9,2)-78,1))"
Worksheets("TANK TABLE").Range("I10").Formula = "=IF(G10=0,0,INDEX('TABLE 54B'!A$1:W$105,H10+5,100*ROUND(G10,2)-78,1))"
Worksheets("TANK TABLE").Range("I11").Formula = "=IF(G11=0,0,INDEX('TABLE 54B'!A$1:W$105,H11+5,100*ROUND(G11,2)-78,1))"
Worksheets("TANK TABLE").Range("I12").Formula = "=IF(G12=0,0,INDEX('TABLE 54B'!A$1:W$105,H12+5,100*ROUND(G12,2)-78,1))"
Worksheets("TANK TABLE").Range("I13").Formula = "=IF(G13=0,0,INDEX('TABLE 54B'!A$1:W$105,H13+5,100*ROUND(G13,2)-78,1))"
Worksheets("TANK TABLE").Range("I14").Formula = "=IF(G14=0,0,INDEX('TABLE 54B'!A$1:W$105,H14+5,100*ROUND(G14,2)-78,1))"
Worksheets("TANK TABLE").Range("I15").Formula = "=IF(G15=0,0,INDEX('TABLE 54B'!A$1:W$105,H15+5,100*ROUND(G15,2)-78,1))"
Worksheets("TANK TABLE").Range("I16").Formula = "=IF(G16=0,0,INDEX('TABLE 54B'!A$1:W$105,H16+5,100*ROUND(G16,2)-78,1))"
Worksheets("TANK TABLE").Range("I17").Formula = "=IF(G17=0,0,INDEX('TABLE 54B'!A$1:W$105,H17+5,100*ROUND(G17,2)-78,1))"
Worksheets("TANK TABLE").Range("I18").Formula = "=IF(G18=0,0,INDEX('TABLE 54B'!A$1:W$105,H18+5,100*ROUND(G18,2)-78,1))"
Worksheets("TANK TABLE").Range("I23").Formula = "=IF(G23=0,0,INDEX('TABLE 54B'!A$1:W$105,H23+5,100*ROUND(G23,2)-78,1))"
Worksheets("TANK TABLE").Range("I24").Formula = "=IF(G24=0,0,INDEX('TABLE 54B'!A$1:W$105,H24+5,100*ROUND(G24,2)-78,1))"
Worksheets("TANK TABLE").Range("I25").Formula = "=IF(G25=0,0,INDEX('TABLE 54B'!A$1:W$105,H25+5,100*ROUND(G25,2)-78,1))"
Worksheets("TANK TABLE").Range("I26").Formula = "=IF(G26=0,0,INDEX('TABLE 54B'!A$1:W$105,H26+5,100*ROUND(G26,2)-78,1))"
Worksheets("TANK TABLE").Range("K9").Formula = "=F9*I9*(G9-0.0011)"
Worksheets("TANK TABLE").Range("K10").Formula = "=F10*I10*(G10-0.0011)"
Worksheets("TANK TABLE").Range("K11").Formula = "=F11*I11*(G11-0.0011)"
Worksheets("TANK TABLE").Range("K12").Formula = "=F12*I12*(G12-0.0011)"
Worksheets("TANK TABLE").Range("K13").Formula = "=F13*I13*(G13-0.0011)"
Worksheets("TANK TABLE").Range("K14").Formula = "=F14*I14*(G14-0.0011)"
Worksheets("TANK TABLE").Range("K15").Formula = "=F15*I15*(G15-0.0011)"
Worksheets("TANK TABLE").Range("K16").Formula = "=F16*I16*(G16-0.0011)"
Worksheets("TANK TABLE").Range("K17").Formula = "=F17*I17*(G17-0.0011)"
Worksheets("TANK TABLE").Range("K18").Formula = "=F18*I18*(G18-0.0011)"
Worksheets("TANK TABLE").Range("K23").Formula = "=F23*I23*(G23-0.0011)"
Worksheets("TANK TABLE").Range("K24").Formula = "=F24*I24*(G24-0.0011)"
Worksheets("TANK TABLE").Range("K25").Formula = "=F25*I25*(G25-0.0011)"
Worksheets("TANK TABLE").Range("K26").Formula = "=F26*I26*(G26-0.0011)"
Worksheets("TANK TABLE").Range("J30").Formula = "=H30-H29"
Worksheets("TANK TABLE").Range("E29").Formula = "= K19- D29"
Worksheets("TANK TABLE").Range("E30").Formula = "= K27-D30 "
' 运行原有代码
ws.Protect Password:="`111111"
End Sub
3
Sub 恢复()
Dim ws As Worksheet
Set ws = Worksheets("TANK TABLE")
ws.Unprotect Password:="`111111"
Worksheets("测量记录").Activate
n = Selection.Row
Worksheets("TANK TABLE").Cells(2, 11).Value = Worksheets("测量记录").Cells(n, 1).Value
Worksheets("TANK TABLE").Cells(2, 2).Value = Worksheets("测量记录").Cells(n, 2).Value
Worksheets("TANK TABLE").Cells(9, 5).Value = Worksheets("测量记录").Cells(n, 3).Value
Worksheets("TANK TABLE").Cells(10, 5).Value = Worksheets("测量记录").Cells(n, 4).Value
Worksheets("TANK TABLE").Cells(11, 5).Value = Worksheets("测量记录").Cells(n, 5).Value
Worksheets("TANK TABLE").Cells(12, 5).Value = Worksheets("测量记录").Cells(n, 6).Value
Worksheets("TANK TABLE").Cells(13, 5).Value = Worksheets("测量记录").Cells(n, 7).Value
Worksheets("TANK TABLE").Cells(14, 5).Value = Worksheets("测量记录").Cells(n, 8).Value
Worksheets("TANK TABLE").Cells(15, 5).Value = Worksheets("测量记录").Cells(n, 9).Value
Worksheets("TANK TABLE").Cells(16, 6).Value = Worksheets("测量记录").Cells(n, 10).Value
Worksheets("TANK TABLE").Cells(17, 6).Value = Worksheets("测量记录").Cells(n, 11).Value
Worksheets("TANK TABLE").Cells(18, 6).Value = Worksheets("测量记录").Cells(n, 12).Value
Worksheets("TANK TABLE").Cells(23, 5).Value = Worksheets("测量记录").Cells(n, 13).Value
Worksheets("TANK TABLE").Cells(24, 5).Value = Worksheets("测量记录").Cells(n, 14).Value
Worksheets("TANK TABLE").Cells(25, 5).Value = Worksheets("测量记录").Cells(n, 15).Value
Worksheets("TANK TABLE").Cells(26, 6).Value = Worksheets("测量记录").Cells(n, 16).Value
Worksheets("TANK TABLE").Cells(9, 7).Value = Worksheets("测量记录").Cells(n, 17).Value
Worksheets("TANK TABLE").Cells(10, 7).Value = Worksheets("测量记录").Cells(n, 18).Value
Worksheets("TANK TABLE").Cells(11, 7).Value = Worksheets("测量记录").Cells(n, 19).Value
Worksheets("TANK TABLE").Cells(12, 7).Value = Worksheets("测量记录").Cells(n, 20).Value
Worksheets("TANK TABLE").Cells(13, 7).Value = Worksheets("测量记录").Cells(n, 21).Value
Worksheets("TANK TABLE").Cells(14, 7).Value = Worksheets("测量记录").Cells(n, 22).Value
Worksheets("TANK TABLE").Cells(15, 7).Value = Worksheets("测量记录").Cells(n, 23).Value
Worksheets("TANK TABLE").Cells(16, 7).Value = Worksheets("测量记录").Cells(n, 24).Value
Worksheets("TANK TABLE").Cells(17, 7).Value = Worksheets("测量记录").Cells(n, 25).Value
Worksheets("TANK TABLE").Cells(18, 7).Value = Worksheets("测量记录").Cells(n, 26).Value
Worksheets("TANK TABLE").Cells(23, 7).Value = Worksheets("测量记录").Cells(n, 27).Value
Worksheets("TANK TABLE").Cells(24, 7).Value = Worksheets("测量记录").Cells(n, 28).Value
Worksheets("TANK TABLE").Cells(25, 7).Value = Worksheets("测量记录").Cells(n, 29).Value
Worksheets("TANK TABLE").Cells(26, 7).Value = Worksheets("测量记录").Cells(n, 30).Value
Worksheets("TANK TABLE").Cells(9, 8).Value = Worksheets("测量记录").Cells(n, 31).Value
Worksheets("TANK TABLE").Cells(10, 8).Value = Worksheets("测量记录").Cells(n, 32).Value
Worksheets("TANK TABLE").Cells(11, 8).Value = Worksheets("测量记录").Cells(n, 33).Value
Worksheets("TANK TABLE").Cells(12, 8).Value = Worksheets("测量记录").Cells(n, 34).Value
Worksheets("TANK TABLE").Cells(13, 8).Value = Worksheets("测量记录").Cells(n, 35).Value
Worksheets("TANK TABLE").Cells(14, 8).Value = Worksheets("测量记录").Cells(n, 36).Value
Worksheets("TANK TABLE").Cells(15, 8).Value = Worksheets("测量记录").Cells(n, 37).Value
Worksheets("TANK TABLE").Cells(16, 8).Value = Worksheets("测量记录").Cells(n, 38).Value
Worksheets("TANK TABLE").Cells(17, 8).Value = Worksheets("测量记录").Cells(n, 39).Value
Worksheets("TANK TABLE").Cells(18, 8).Value = Worksheets("测量记录").Cells(n, 40).Value
Worksheets("TANK TABLE").Cells(23, 8).Value = Worksheets("测量记录").Cells(n, 41).Value
Worksheets("TANK TABLE").Cells(24, 8).Value = Worksheets("测量记录").Cells(n, 42).Value
Worksheets("TANK TABLE").Cells(25, 8).Value = Worksheets("测量记录").Cells(n, 43).Value
Worksheets("TANK TABLE").Cells(26, 8).Value = Worksheets("测量记录").Cells(n, 44).Value
Worksheets("TANK TABLE").Cells(29, 4).Value = Worksheets("测量记录").Cells(n, 45).Value
Worksheets("TANK TABLE").Cells(30, 4).Value = Worksheets("测量记录").Cells(n, 46).Value
Worksheets("TANK TABLE").Cells(29, 8).Value = Worksheets("测量记录").Cells(n, 47).Value
Worksheets("TANK TABLE").Cells(30, 8).Value = Worksheets("测量记录").Cells(n, 48).Value
Worksheets("TANK TABLE").Cells(29, 10).Value = Worksheets("测量记录").Cells(n, 49).Value
Worksheets("TANK TABLE").Cells(30, 10).Value = Worksheets("测量记录").Cells(n, 50).Value
Worksheets("TANK TABLE").Cells(29, 12).Value = Worksheets("测量记录").Cells(n, 51).Value
Worksheets("TANK TABLE").Cells(30, 12).Value = Worksheets("测量记录").Cells(n, 52).Value
Worksheets("TANK TABLE").Cells(9, 12).Value = Worksheets("测量记录").Cells(n, 53).Value
Worksheets("TANK TABLE").Cells(10, 12).Value = Worksheets("测量记录").Cells(n, 54).Value
Worksheets("TANK TABLE").Cells(11, 12).Value = Worksheets("测量记录").Cells(n, 55).Value
Worksheets("TANK TABLE").Cells(12, 12).Value = Worksheets("测量记录").Cells(n, 56).Value
Worksheets("TANK TABLE").Cells(13, 12).Value = Worksheets("测量记录").Cells(n, 57).Value
Worksheets("TANK TABLE").Cells(14, 12).Value = Worksheets("测量记录").Cells(n, 58).Value
Worksheets("TANK TABLE").Cells(15, 12).Value = Worksheets("测量记录").Cells(n, 59).Value
Worksheets("TANK TABLE").Cells(16, 12).Value = Worksheets("测量记录").Cells(n, 60).Value
Worksheets("TANK TABLE").Cells(17, 12).Value = Worksheets("测量记录").Cells(n, 61).Value
Worksheets("TANK TABLE").Cells(18, 12).Value = Worksheets("测量记录").Cells(n, 62).Value
Worksheets("TANK TABLE").Cells(23, 12).Value = Worksheets("测量记录").Cells(n, 63).Value
Worksheets("TANK TABLE").Cells(24, 12).Value = Worksheets("测量记录").Cells(n, 64).Value
Worksheets("TANK TABLE").Cells(25, 12).Value = Worksheets("测量记录").Cells(n, 65).Value
Worksheets("TANK TABLE").Cells(26, 12).Value = Worksheets("测量记录").Cells(n, 66).Value
' 运行原有代码
ws.Protect Password:="`111111"
End Sub
|
|