Hi,
In the following code, I am getting error 1004 on the last line (red). All I am trying to do is copy data from an range and paste it into another range.
Error: Run-time error '1004': Pastespecial method or range class failed.
What am I doing wrong?
Thanks
In the following code, I am getting error 1004 on the last line (red). All I am trying to do is copy data from an range and paste it into another range.
Error: Run-time error '1004': Pastespecial method or range class failed.
What am I doing wrong?
Thanks
Code:
Public Sub Testing()
Dim Rng1 As Range
Dim oCell As Range
Dim holder As Range
Dim Target As Range
Dim WSaddr As String
Set Rng1 = Selection
Set holder = Range(Rng1, ActiveCell.End(xlDown))
Range(Rng1, ActiveCell.End(xlDown)).Copy
Set Target = Application.InputBox _
(prompt:="Select Target cell", Title:="Target", Left:=-2, Top:=-10, Type:=8)
Target.Select
[COLOR="#FF0000"]Target.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False[/COLOR]
End Sub
Last edited: