|
楼主 |
发表于 2011-12-12 22:32
|
显示全部楼层
- Sub 表3公式()
- Application.Calculation = xlCalculationManual '手动重算
- With Sheets("Sheet3")
- b = .Range("d65536").End(xlUp).Row
- If b > 1 Then
- .Range("A2:A" & b).FormulaR1C1 = "=IF(RC[5]="""","""",0)"
- .Range("C2:C" & b).FormulaR1C1 = "=IF(RC[3]="""","""",0)"
- .Range("E2").FormulaR1C1 = "=IF(RC[1]="""","""",1)"
- .Range("E3:E" & b).FormulaR1C1 = "=IF(RC[1]="""","""",IF(RC[1]=R[-1]C[1],R[-1]C+1,1))"
- .Range("F2:F" & b).FormulaR1C1 = "=IF(数据录入!RC[-5]="""","""",数据录入!RC[-5])"
- .Range("G2:G" & b).FormulaR1C1 = "=IF(RC[-1]="""","""",1)"
- .Range("H2:H" & b).FormulaR1C1 = "=IF(RC[-2]="""","""",数据录入!RC[-1])"
- .Range("I2:I" & b).FormulaR1C1 = "=IF(RC[-1]="""","""",数据录入!RC[-1])"
- .Range("L2:L" & b).FormulaR1C1 = "=IF(RC[-6]="""","""",""*"")"
- .Range("M2:M" & b).FormulaR1C1 = "=IF(RC[-5]="""","""",数据录入!RC[-4])"
- .Range("N2:N" & b).FormulaR1C1 = "=IF(RC[-6]="""","""",RC[-1])"
- .Range("O2:O" & b).FormulaR1C1 = "=IF(RC[-7]="""","""",数据录入!RC[-5])"
- .Range("P2:P" & b).FormulaR1C1 = "=IF(RC[-8]="""","""",数据录入!RC[-5])"
- .Range("Q2:Q" & b).FormulaR1C1 = "=IF(RC[-9]="""","""",数据录入!RC[-5])"
- .Range("S2:S" & b).FormulaR1C1 = _
- "=IF(RC[-13]="""","""",IF(数据录入!RC[3]="""","""",数据录入!RC[3]))"
- .Range("T2:T" & b).FormulaR1C1 = "=IF(RC[-5]="""","""",RC[-5])"
- .Range("U2:U" & b).FormulaR1C1 = "=IF(RC[-15]="""","""",0)"
- .Range("V2:V" & b).FormulaR1C1 = "=IF(RC[-16]="""","""",0)"
- .Range("X2:X" & b).FormulaR1C1 = "=IF(RC[-18]="""","""",0)"
- .Range("Z2:Z" & b).FormulaR1C1 = "=IF(RC[-20]="""","""",数据录入!RC[-13])"
- .Range("AA2:AA" & b).FormulaR1C1 = "=IF(RC[-1]="""","""",数据录入!RC[-13])"
- .Range("AF2:AF" & b).FormulaR1C1 = "=IF(RC[-26]="""","""",0)"
- .Range("AG2:AG" & b).FormulaR1C1 = "=IF(RC[-27]="""","""",0)"
- .Range("AH2:AH" & b).FormulaR1C1 = "=IF(RC[-28]="""","""",0)"
- .Range("AJ2:AJ" & b).FormulaR1C1 = "=IF(RC[-30]="""","""",0)"
- .Range("AK2:AK" & b).FormulaR1C1 = "=IF(RC[-31]="""","""",0)"
- .Range("AL2:AL" & b).FormulaR1C1 = "=IF(RC[-32]="""","""",0)"
- .Range("A2:AL" & b) = .Range("A2:AL" & b).Value
- End If
- End With
- Application.Calculation = xlCalculationAutomatic '自动重算
- End Sub
复制代码 |
|