My PasteValues Macro!

excelsupernerd

New Member
Joined
Jul 28, 2010
Messages
14
Here's how I've implemented a macro shortcut that will enable you to paste values only, even if it's from an outside application!

Code:
Sub pasteValuesOnly()
'
' Keyboard Shortcut: Ctrl+Shift+V
    ' This allows the macro to pass on to
    ' the next method if it's text from outside of Excel
    On Error Resume Next
    ' This pastes values if from inside of Excel
    Selection.PasteSpecial Paste:=xlPasteValues, _
        Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    'If there was an error, text not from inside Excel
    If Error <> "" Then
        ActiveSheet.PasteSpecial Format:="Text", _
            Link:=False, DisplayAsIcon:=False
    End If
End Sub

Enjoy! Give me feedback and let me know if it works for you too!
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,216,175
Messages
6,129,310
Members
449,499
Latest member
HockeyBoi

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