gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,332
- Office Version
- 365
- Platform
- Windows
I have a table where the user can past in a list. In my directions I ask that when they paste in a list (of Part Numbers) that they copy the list from their other source and then use a button I have on the tab to paste in the data.
This code works. But if the did not copy data from their other source and hit the button they get an error message - which makes sense. There's no data to paste
How can I modify this code so the error code doesn't pop-up?
This code works. But if the did not copy data from their other source and hit the button they get an error message - which makes sense. There's no data to paste
How can I modify this code so the error code doesn't pop-up?
Code:
Sub PasteItemID()
'For User to Paste in a list of Part Numbers
Range("Table2[ItemID]").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("B26").Select
End Sub