I have a spreadsheet that I intercept the paste command so to only paste values from within the workbook.
Its working great at:
'Paste Special - Values Only
Application.OnKey "^v", "PasteValues"
Paste Value moduel:
The only issue is when I try to paste in values from outside of Excel... doing this causes an error "Paste method of class range paste fail"
I tried the following:
'ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False
Which works for pasting text from outside of Excel but errors when paste from within Excel.
So my solution which works but doesn't seem like a good solution is:
On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues 'From within workbook
ActiveSheet.PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:=False 'From outside paste
My question, is there a better way?