My users are getting stuck in a credential verification loop if they mistakenly paste items that have HTML in it to an Excel spreadsheet. They will sometimes be pasting from outlook or other sources and other times they will be pasting from within the workbook. I want to create a hotkey micro that will only paste the value or text on the clipboard. This is the code recorded when pasting from each scenario.
'pasting excel cell
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'pasting from Outlook/Word
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
It's clear from what I researched that the Selection and ActiveSheet objects handle PasteSpecial differently. The only thing I'm unsure about is how to check which object needs to be referenced for pasting the text into the selected cell so this can be as unobtrusive as possible for my users.