Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to turn off "Do you want to save the changes...." from a macro

Status
Not open for further replies.

jeep2001

Programmer
Dec 15, 2005
134
US
Is there a way to stuff a keypress in a macro. I have an EXCEL macro that deletes a column, then saves the worksheet. When the macro runs, I get the prompt...click yes and all is fine. This is great, but I want the macro to run overnight, how can I invoke a keypress "Y" or turn off the "Do you want to save the changes you made...." popup.
 
For future reference, VBA questions should be asked in forum707, the "VBA Visual Basic for Applications (Microsoft) Forum".

Surround the bit that deletes the sheet like this,
Code:
application.displayalerts = false
sheets(2).delete
application.displayalerts = true

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Also take a look at the ScreenUpdating and EnableEvents properties. You must also set these to True when complete.

-----------
Regards,
Zack Barresse

Simplicity is the ultimate sophistication. What is a Microsoft MVP?
- Leonardo da Vinci
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top