Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Paste Special Macro

Status
Not open for further replies.

Andrea001

Technical User
Jan 21, 2002
29
US
I am relatively new to working with macros and I'm trying to accomplish what I thought would be a simple task, but running into road blocks. A co-worker has asked me to put a macro on his computer that will stop him from having to right click on a cell, choose paste special and then select the values option. He would like it to be generic in that what ever is copied into the clipboard will be pasted into the selected cell or range. I recorded the macro using specified cells and then edited it to take out the specified cell ... it didn't like that very much. Does anyone have a simple solution that they would like to share??
Thanks,
Andrea
 
Try this:


Sub Macro1()
'
' Keyboard Shortcut: Ctrl+q
'
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Selection.Activate

End Sub
Jean-Paul
Montreal
mtljp2@sympatico.ca
 
Jean-Paul,
Thanks for your help!! I had the same code but no shortcut key so when I went to run the macro the cell I had chosen was de-activated (pretty stupid of me!!) Anyway, now it works thanks to you!!
Have a good weekend,
Andrea
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top