im2bz2p345
Board Regular
- Joined
- Mar 31, 2008
- Messages
- 229
Hi all,
I am an Excel 365 (32-bit) user that can't seem to get this bit of code to work properly after all sorts of effort.
Here is my current code:
Instead of assigning a key combination using the Application.OnKey command, is it possible to split this up into two separate macros:
1. To copy the sum of numbers that I select
2. Paste-special that sum as values
I would somehow like for this to show up in the Macros windows when you press Alt + F8. Screenshot below.

Any help would be greatly appreciate because I could not get this to work in my version of Excel as the code stands. Thank you!!
~ Im2bz2p345
I am an Excel 365 (32-bit) user that can't seem to get this bit of code to work properly after all sorts of effort.
Here is my current code:
VBA Code:
Public Sub Create_Shortcuts()
'Ctrl + Shift + C
Application.OnKey "^+C", "StoreSum"
'Ctrl + Shift + V
Application.OnKey "^+V", "PasteSum"
End Sub
Sub StoreSum()
Dim mySum As String
mySum = WorksheetFunction.Sum(Selection)
SaveSetting "SelectionSum", "Section1", "Key1", mySum
End Sub
Sub PasteSum()
ActiveCell.Value = GetSetting("SelectionSum", "Section1", "Key1")
End Sub
Instead of assigning a key combination using the Application.OnKey command, is it possible to split this up into two separate macros:
1. To copy the sum of numbers that I select
2. Paste-special that sum as values
I would somehow like for this to show up in the Macros windows when you press Alt + F8. Screenshot below.

Any help would be greatly appreciate because I could not get this to work in my version of Excel as the code stands. Thank you!!
~ Im2bz2p345
