gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
This does and does not work.
I am using this for when someone copies somethig from another workbook. I want them to Paste Values so they dont screw up the tables formatting.
if they copied something from another workbook this does paste the value in - but it also presents the Message.
If they didnt copy something and run the code (the code is on a button on the sheet) then the message pops up like expected and no error to stop
How do I fix this so that the message only appears if the code errors?
thanks for the help
I am using this for when someone copies somethig from another workbook. I want them to Paste Values so they dont screw up the tables formatting.
if they copied something from another workbook this does paste the value in - but it also presents the Message.
If they didnt copy something and run the code (the code is on a button on the sheet) then the message pops up like expected and no error to stop
How do I fix this so that the message only appears if the code errors?
Code:
Sub PasteValues123()
'
On Error GoTo ErrMsg
Sheets("Step 2").Range("C16").Select
ActiveSheet.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:= _
False, NoHTMLFormatting:=True
Application.CutCopyMode = False
ErrMsg:
MsgBox "There isnt anything to Paste"
End Sub
thanks for the help