anonymous No title
No License VBA
2021年06月27日
Copy Clone
'ブックモジュール
Option Explicit

Private Sub Workbook_Open()
    Application.OnKey "+^{c}", "inTotal"
    Application.OnKey "+^{+}", "plusTotal"
    Application.OnKey "+^{v}", "outTotal"
    Application.OnKey "+^{*}", "clearTotal"
End Sub

'標準モジュール
Option Explicit

Dim stackSum As Double

Sub inTotal()
    stackSum = WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub

Sub plusTotal()
    stackSum = stackSum + WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub


Sub outTotal()
    Selection.Value = stackSum
End Sub

Sub clearTotal()
    stackSum = 0
    Application.StatusBar = False
End Sub

'ブックモジュール
Option Explicit

Private Sub Workbook_Open()
    Application.OnKey "+^{c}", "inTotal"
    Application.OnKey "+^{+}", "plusTotal"
    Application.OnKey "+^{v}", "outTotal"
    Application.OnKey "+^{*}", "clearTotal"
End Sub

'標準モジュール
Option Explicit

Dim stackSum As Double

Sub inTotal()
    stackSum = WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub

Sub plusTotal()
    stackSum = stackSum + WorksheetFunction.Sum(Selection)
    Application.StatusBar = "stackSum = " & Format(stackSum, "#,##0")
End Sub


Sub outTotal()
    Selection.Value = stackSum
End Sub

Sub clearTotal()
    stackSum = 0
    Application.StatusBar = False
End Sub

No one still commented. Please first comment.