Hi,
Have one old custom made (not by myself) macro which copies Sum of selected cells and then puts it into clipboard. It works on my machine, but won't work copied to another excel. Here's the code
>>> use code - tags <<<
First error was in "Dim obj As New DataObject", I changed it to "Dim obj As Object" and then got run-time error 91 on this line "obj.SetText sTemp". And now I'm confused why this macro still works in my Excel but not in another.
Any ideas how to fix this?
Have one old custom made (not by myself) macro which copies Sum of selected cells and then puts it into clipboard. It works on my machine, but won't work copied to another excel. Here's the code
>>> use code - tags <<<
Code:
Sub StatusBar_Sum()
Dim sTemp As String
Dim R As Range
Dim f As Variant
Dim obj As New DataObject
Set R = Selection
Set f = Application.WorksheetFunction
sTemp = sTemp & f.Sum(R) & vbCrLf
obj.SetText sTemp
obj.PutInClipboard
End Sub
Any ideas how to fix this?
Last edited by a moderator: