Pages

Tuesday, March 20, 2012

method1:
sub PasteValues()

' Keyboard Shortcut: Ctrl+v

On Error Resume Next

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.CutCopyMode = False

End Sub

Sub Auto_Open()


Application.CommandBars("Cell").Reset
With Application.CommandBars("Cell")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click cell paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Row").Reset
With Application.CommandBars("Row")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click row paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Column").Reset
With Application.CommandBars("Column")
.Controls("Paste").OnAction = "PasteValues" ' Changes right click column paste to use Pastevalues macro
.Controls(4).Delete ' removes paste secial option
End With

Application.CommandBars("Worksheet Menu Bar").Reset
With Application.CommandBars("Worksheet Menu Bar").Controls
.Item(2).Controls(6).OnAction = "PasteValues" ' changes edit/paste to use Pastevalues macro
.Item(2).Controls(7).Enabled = False ' disable paste special
End With

Application.CommandBars("Standard").Reset
With Application.CommandBars("Standard").Controls.Item(12)
.Enabled = False
End With
End Sub

2.http://www.rondebruin.nl/values.htm

0 comments:

 

site weekly hits