I am trying to make a macro that allows a user to select a cell or a range of cells and then paste them to a location that they want.
I found some code that allows the user to select a range to paste to and tried to modify it to also copy but to no avail, can anyone help me out.
Here is the code that pastes to a range that you select:
How can i edit the above so that it copies a selected range.
I tried this but it didnt work
Thanks in advance
- DeusXv
I found some code that allows the user to select a range to paste to and tried to modify it to also copy but to no avail, can anyone help me out.
Here is the code that pastes to a range that you select:
Code:
Sub PasteRange()
With Sheets("Sheet1")
On Error Resume Next
Set Ret = Application.InputBox(Prompt:="Please select a range where you want to paste", Type:=8)
On Error GoTo 0
If Not Ret Is Nothing Then
.Range("$AD$10").Copy
Ret.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End If
End With
End Sub
How can i edit the above so that it copies a selected range.
I tried this but it didnt work
Code:
With Sheets("Sheet1")
On Error Resume Next
Set Ret = Application.InputBox(Prompt:="Please select a range to copy", Type:=8)
On Error GoTo 0
If Not Ret Is Nothing Then
.Range("$AD$10").Copy
Ret.CopySpecial Copy:=xCopyValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End If
End With
Thanks in advance
- DeusXv
Last edited: