Object of the Macro : To get copied to the clipboard, the sum of the cells selected in a worksheet so that it can pasted directly without having to sum the numbers in the cell, copy the sum and then paste.
Macro:
Sub CopySum()Dim xOb As New DataObjectxOb.ClearxOb.SetText Application.WorksheetFunction.Sum(Application.ActiveWindow.RangeSelection)xOb.PutInClipboardEnd Sub
If the macro throws a compile error that the "User-defined type not defined", here's the way-out
Open References in Word VBA
Click on Browse
Pick up this file and click Open
C:\WINDOWS\SYSTEM\FM20.DLL
No comments:
Post a Comment