I'm trying to force users to paste as values to preserve conditional formatting in the workbook.
The following works for numbers but can someone please assist me in how to modify the code for pasting unformatted text (ie. from the internet) - at the moment this is returning an error because i have overriden ctrl + v. I'm thinking an if statement but not very familiar with the syntax of VBA to implement this.
I would also like to change it do dismiss the error message when there is nothing on the clipboard: Run-time error '1004': PasteSpecial method of Range Class failed.
Thanks in advance for any help.
The following works for numbers but can someone please assist me in how to modify the code for pasting unformatted text (ie. from the internet) - at the moment this is returning an error because i have overriden ctrl + v. I'm thinking an if statement but not very familiar with the syntax of VBA to implement this.
I would also like to change it do dismiss the error message when there is nothing on the clipboard: Run-time error '1004': PasteSpecial method of Range Class failed.
Thanks in advance for any help.
Code:
Sub paste_as_values()'
' paste_as_values Macro
' Paste as values to retain conditional formatting. Do not override.
'
' Keyboard Shortcut: Ctrl+v
'
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub