macro help - closing without saving & empty clipboard

B

Bry

Hi

i have a number of macro's that open and close different wokbooks to analyse
data. at the moment they run fine but i have to manualy click 'no' on saving
changes and to indicate that the large amount of information on the clipboard
is no longer required. can someone please tell me the code to enter to do
this?

many thanks
Bry
 
D

Don Guillett

One I use to close all

Sub CLOSE_ALL()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each w In Workbooks
w.Save
Next w
Application.Quit
End Sub
 
G

Gord Dibben

Application.CutCopyMode = False

Stick this in after any paste step to clear the clipboard.


Gord Dibben MS Excel MVP
 
B

Bry

Thanks Gord, that works fine.

Don, thanks for the advice but sometimes i dont want to close all workbooks
though just the current one, im typicaly using 2 or 3 at a time.
 

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