ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   macro help - closing without saving & empty clipboard (https://www.excelbanter.com/excel-discussion-misc-queries/118736-macro-help-closing-without-saving-empty-clipboard.html)

Bry

macro help - closing without saving & empty clipboard
 
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

Don Guillett

macro help - closing without saving & empty clipboard
 
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

--
Don Guillett
SalesAid Software

"Bry" wrote in message
...
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




Gord Dibben

macro help - closing without saving & empty clipboard
 
Application.CutCopyMode = False

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


Gord Dibben MS Excel MVP

On Tue, 14 Nov 2006 08:37:01 -0800, Bry wrote:

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



Bry

macro help - closing without saving & empty clipboard
 
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.

"Gord Dibben" wrote:

Application.CutCopyMode = False

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


Gord Dibben MS Excel MVP

On Tue, 14 Nov 2006 08:37:01 -0800, Bry wrote:

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





All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com