vba

作者: datagirl | 来源:发表于2022-07-06 09:38 被阅读0次
图1.png

vba代码:
Sub payable()

Cells(4, 5) = Cells(4, 3) * Cells(4, 4) * 0.2
Cells(4, 6) = Cells(4, 3) * Cells(4, 4) * 0.1
Cells(4, 7) = Cells(4, 3) * Cells(4, 4) * 0.05
End Sub

为了使代码简洁,降低拼写错误概率,引入变量,将

代码更改为:
Sub payable()

x= Cells(4, 3) * Cells(4, 4)
Cells(4, 5) = x * 0.2
Cells(4, 6) = x * 0.1
Cells(4, 7) = x * 0.05

End Sub

相关文章

网友评论

      本文标题:vba

      本文链接:https://www.haomeiwen.com/subject/eggebrtx.html