2つの列から取得した2つの数値を乗算して、3番目の列に表示できるようにしたいと思います。
ユーザーが数字を入力する2つの列と、ユーザーがEnterキーを押すと自動的に数字を乗算する3番目の列があります。
しかし、私はこれらのような100個のテキストボックスを持っており、それらのすべてのコードを書きたくありません。
Excelのようにこの操作を実行する方法はありますか?エクセルでそれを行うのは本当に簡単です。
これが私がすべてのテキストボックスのために書かなければならないことです:
Private Sub Text03_GotFocus()
Text05.Value = Val(Text03.Value) * Val(Text04.Value) * 12
End Sub
Private Sub Text03_LostFocus()
Text05.Value = Val(Text03.Value) * Val(Text04.Value) * 12
End Sub
Private Sub Text04_GotFocus()
Text05.Value = Val(Text03.Value) * Val(Text04.Value) * 12
End Sub
Private Sub Text04_LostFocus()
Text05.Value = Val(Text03.Value) * Val(Text04.Value) * (12)
End Sub