Deleting a sheet during macro

J

jeff

During a macro, a sheet is deleted. However, the user gets a box that
basically asks if it’s ok to continue. The message is “Data may exist
in the sheet(s) selected for deletion. To permanently delete the data,
press Delete.”
Is there a way to prevent this message from coming up? It will only
cause confusion to the user.
Thanks,
jeff
 
R

Rick Rothstein

Try it this way...

Application.DisplayAlerts = False
Sheets("Sheet8").Delete 'Change sheet name as needed
Application.DisplayAlerts = True

--
Rick (MVP - Excel)


During a macro, a sheet is deleted. However, the user gets a box that
basically asks if it’s ok to continue. The message is “Data may exist
in the sheet(s) selected for deletion. To permanently delete the data,
press Delete.”
Is there a way to prevent this message from coming up? It will only
cause confusion to the user.
Thanks,
jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top