Hello,
I would appreciate any help with this macro...it copies the cells values in the first half no problem, but I also
need it to mouse click the sum in the second part. It returns runtime error "424" Object required.
Sub samplesum6() Dim rng As Range
Dim inp As Range
Dim x As Range
If TypeName(Selection) <> "Range" Then
MsgBox "Select a range first."
Else
Set inp = Selection
End If
Set rng = Application.InputBox("copy to", Type:=8)
If Not rng Is Nothing Then
rng.Parent.Activate
rng.Select
inp.Copy
ActiveSheet.Paste link:=True
End If
Set x = Application.Sum(inp)
Set rng = Application.InputBox("copy to", Type:=8)
If Not rng Is Nothing Then
rng.Parent.Activate
rng.Select
x.Copy
ActiveSheet.Paste link:=True
End If
End Sub
I would appreciate any help with this macro...it copies the cells values in the first half no problem, but I also
need it to mouse click the sum in the second part. It returns runtime error "424" Object required.
Sub samplesum6() Dim rng As Range
Dim inp As Range
Dim x As Range
If TypeName(Selection) <> "Range" Then
MsgBox "Select a range first."
Else
Set inp = Selection
End If
Set rng = Application.InputBox("copy to", Type:=8)
If Not rng Is Nothing Then
rng.Parent.Activate
rng.Select
inp.Copy
ActiveSheet.Paste link:=True
End If
Set x = Application.Sum(inp)
Set rng = Application.InputBox("copy to", Type:=8)
If Not rng Is Nothing Then
rng.Parent.Activate
rng.Select
x.Copy
ActiveSheet.Paste link:=True
End If
End Sub