• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA automatically pasting over existing contents and deleting a sheet

I have a fairly simple VBA that copies contents from one sheet to another then deletes the sheet. However, when it is pasting the contents it asks me if I want to paste over the contents of the existing cells. I know the answer will always be yes. Is there a way that I can automatically select yes with the VBA so that the user (who may not know the correct response) will not have to click yes every time?


Also when the worksheet is being deleted it always asks if I want to delete the sheet because it has contents. The answer will always be "delete," but again I don't want to confuse the user.


Any advice on these two issues?
 
Before you do something that would normally generate an error notice, you can use:

[pre]
Code:
Application.DisplayAlerts = False
'Delete sheet, cells, etc
Application.DisplayAlerts = True
[/pre]
 
Back
Top