Sub SumToClipboard()
'Must enable Forms Library: Checkmark Tools > References > Microsoft Forms 2.0 Object Library
Dim obj As New DataObject, n As Double
n = Application.Sum(Selection)
obj.SetText n
obj.PutInClipboard
End Sub
Please update your account details to show what version of Excel you are using.
If you are using MS 365 do you really need a macro for that ?
When you select your values the Sum (Average, Count and some other calculations you can display) will show in the Status bar.
A "Single Click" on the value in the Status bar will copy it into the clipboard. Ctrl+V to paste it wherever you want to place the result.
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.