LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Closing Workbooks Formula

Windows("Book1").Close savechanges:=False
Windows("Book2").Activate
Cells.Select
Selection.Cut
Windows("Book2").ActivateNext
Range("A1").Select
ActiveSheet.Paste
Windows("Book2").Close savechanges:=False

This is the formula I am using to close my extra workbooks. Is there a way
I can do this without the specific ("Book2") or ("Book1")??? Because that
makes it so the only way this macro will run is by closing down excel and
restarting it. I wanted to do the same thing without naming specific
workbooks. SO, the macro opens a total of three workbooks:

"Original Name of File being opened"
"Workbook1"
"Workbook2"

So how do I jumb between workbooks and activate them without naming them
specifically then ultimately close them. THANKS!!!!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Disabling formula recalculation when opening or closing workbooks Joe Excel Discussion (Misc queries) 3 August 5th 08 09:24 PM
Closing Workbooks bodhisatvaofboogie Excel Programming 4 June 20th 06 01:57 PM
Closing Other Workbooks Tim Mayes[_2_] Excel Programming 4 December 13th 04 11:08 PM
Closing workbooks Mischa Browne Excel Programming 4 June 17th 04 04:16 PM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"