Copy paste macro needs tweak

[Solved/Closed]
Report
Posts
3
Registration date
Tuesday March 1, 2016
Status
Member
Last seen
March 8, 2016
-
Posts
3
Registration date
Tuesday March 1, 2016
Status
Member
Last seen
March 8, 2016
-
Hello,
I'm new to VBA, and would appreciate any help with this Macro. It copys the mouse input, but overwrites the last paste. I need it to (after I hit a command
button) to ask (with input box) where to paste. I would click "D32" or any other
cell in the same worksheet.
Thanks

Sub CopyStuff()

Dim x As Range
Dim y As Range

Set x = Application.InputBox("Select what copy using the mouse", Type:=8)
Set y = ActiveWorkbook.Sheets("Sheet2").Range("C32")

x.Copy y

End Sub

2 replies

Posts
2809
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 23, 2021
483
Hi Frank,

You basically gave yourself the answer:
Sub CopyStuff() 

Dim x As Range 
Dim y As Range 

Set x = Application.InputBox("Select what copy using the mouse", Type:=8) 
Set y = Application.InputBox("Select where paste using the mouse", Type:=8)

x.Copy y 

End Sub 


Best regards,
Trowa

Monday, Tuesday and Thursday are usually the days I'll respond. Bear this in mind when awaiting a reply.
Posts
3
Registration date
Tuesday March 1, 2016
Status
Member
Last seen
March 8, 2016

Thanks for the reply......It works!