Copy paste macro needs tweak

Solved/Closed
frank7788 Posts 3 Registration date Tuesday March 1, 2016 Status Member Last seen March 8, 2016 - Mar 2, 2016 at 12:25 PM
frank7788 Posts 3 Registration date Tuesday March 1, 2016 Status Member Last seen March 8, 2016 - Mar 8, 2016 at 01:38 PM
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
Related:

2 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Mar 8, 2016 at 11:56 AM
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.
0
frank7788 Posts 3 Registration date Tuesday March 1, 2016 Status Member Last seen March 8, 2016
Mar 8, 2016 at 01:38 PM
Thanks for the reply......It works!
0