Excel VBA code to only paste values after manually copying cell/range of cells

dcsooner27

New Member
Joined
Jun 11, 2013
Messages
3
I am having trouble creating a macro that pastes values after I have manually copied a cell/range of cells. The ultimate goal is to create a shortcut so I can select any cell, press CTRL + C to copy, and then go to any other cell and press CTRL + "macro shortcut" to paste values.
I need paste values because I do not want to copy the formatting, and I am also sometimes copying cells that are formulas. I know I can just right-click and select paste values but this would actually save me a lot of time.
I have searched everywhere and tried multiple code suggestions, but every time I get "Run-time error '1004': PasteSpecial method of Range class failed".
Any help is appreciated.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
you could try:
Code:
Sub dcsooner27()
'for tp://www.mrexcel.com/forum/excel-questions/743181-excel-visual-basic-applications-code-only-paste-values-after-manually-copying-cell-range-cells.html
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
End Sub
then assign a shortcut key to that.
It will paste values to wherever you have selected.

if you are using excel 2010, all you need to do is right click, v to paste values.
 
Upvote 0

Forum statistics

Threads
1,215,517
Messages
6,125,288
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top