Paste Special Macro

A

Aaron

Hi,

I was hoping that someone could tell me how to create a
macro that I can link to a customized button on my
toolbar that simply does a "edit" "paste
special" "values". I have to use this function quite a
bit throughout my day and just wanted a shortcut. Thanks
for your help.

Aaron
 
B

Bernie Deitrick

Aaron,

Excel has a button that does this, but it isn't shown by default. Right
click on a commandbar, choose customize, then choose the "Commands" tab,
"Edit" category, and then drag the "Paste Values" button from the commands
window to the commandbar where you want it to appear. I have mine to the
right of the regualr paste.

HTH,
Bernie
MS Excel MVP
 
M

Myrna Larson

I use the following macro, and I've attached a shortcut key to it,
CTRL+SHIFT+V. It requires only that you select the cells to be converted (must
be a single-area selection); it does *both* the copying and the pasting.

Sub ConvertToValues()
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
With Selection
.Copy
.PasteSpecial Paste:=xlValues
End With
With Application
.CutCopyMode = False
.DisplayAlerts = True
End With
End Sub 'ConvertToValues
 
B

Bernie Deitrick

Myrna,

Why not just?

Sub ConvertToValues()
Selection.Value = Selection.Value
End Sub

Bernie
 
D

Dave Peterson

If I put '000001 in a cell (so it's text), then use .value = .value, it's
converted to real numbers.

If I have a value in a cell that uses character by character formatting, then I
lose that.

But I don't see a difference if you know your data.
 
Top