I want to delete a sheet in a macro but when I run the macro, I always get a message warning and I have to answer the msg box to delete the page. Below is the macro command I am using.
Sheets("Tel").Select
ActiveWindow.SelectedSheets.Delete
I want to delete a sheet in a macro but when I run the macro, I always get a message warning and I have to answer the msg box to delete the page. Below is the macro command I am using.
Sheets("Tel").Select
ActiveWindow.SelectedSheets.Delete
Last edited by xcelwannabee; 06-19-2009 at 01:33 PM.
See VBE Help for the DisplayAlerts property.
Please edit your post to add code tags.
Entia non sunt multiplicanda sine necessitate
Hello excelwannabee,
Use this line to answer the message box for you. VBA will use whatever the dialog's default button is. In this case, "Delete" is the default.
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Newbie tries again.
I want to delete a sheet in a macro but when I run the macro...I always get a message warning and I have to answer the msg box to delete the page. Below is the macro command I am using.
Please Login or Register to view this content.
Threads merged.
There's no need to start a new thread, and Leith has answered your question.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks