xlPasteValues is Empty

  • Thread starter Thread starter Mike H.
  • Start date Start date
M

Mike H.

How can I test that there is something to paste so that executing this line
of code does not return an error 1004. I am not capturing anything via VBA.
I am just wanting to paste what is in the clipboard. But if nothing is there
I get the error. Thanks!

Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
 
How about just error wrapping it

On Error Resume Next
Selection.PasteSpecial Paste:=xlPasteValues, _
Operation:=xlNone, _
SkipBlanks:=False, _
Transpose:=False
On Error Goto 0

HTH

Bob
 
Gosh, Bob. That was too simple! I will certainly solve it that way. I've
done that many times before but had a senior moment this time, I s'pose!
Thanks!
 
Back
Top