Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hmmm...it looks to be trying to work, but I can't seem to get it to do what
it is supposed to. Essentially nothing is happening though. No errors are popping up. Maybe I did something wrong. Break it down simply for me please!!! :) "Tom Ogilvy" wrote: for each bk in application.Workbooks if bk.Windows(1).Visible then if bk.Name < "Name of book not to close" then bk.close SaveChanges:=False end if end if Next -- Regards, Tom Ogilvy "bodhisatvaofboogie" wrote: I am creating a macro to do some pretty wacky filtering. Some of the ways That I have it doing it is through pasting onto new workbooks. SO, after I've reached the end result (which it seems to be working nicely) I have two extra documents open and I wanted to incorporate into my macro to close them automatically. I went ahead and recorded a macro of closing those two documents, and this is what it looked like: Windows("Book1").Activate ActiveWindow.Close Windows("Original Filename").Activate ActiveWindow.Close Which effectively leaves me on Book 2 with the finished product. SO, I just want everything else to close. That above formula would work nicely on the file it was recorded for, BUT, when I go to use this macro on new documents and data, it won't work the same because the original filename will be different. Any ideas??? Thanks!!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
Error closing Excel after running series of macros | Excel Programming | |||
weird saving of a document with macros resulting with macros being transfered to the copy | Excel Programming | |||
Closing VB triggers closing Excel | Excel Programming | |||
closing excel after closing a workbook | Excel Programming |