Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Help with a quick way to close all duplicate windows using VBA please

I am trying to figure out a way to close all duplicate windows of
workbooks using VBA
I thought this would work but it doesn't.

For Each wb In Workbooks
If Windows.Count 1 Then
For i = 1 To Windows.Count
Windows(2).Close
Next i
End If
Next wb

For example: I have 3 workbooks wb1, wb2, wb3 and with wb3 I have 2
windows open so there are acutally 4 windows total. wb1, wb2, wb3:1,
wb3:2

I only want to close wb3:2. And would prefer to do it without having
to actually activate each workbook.

Any help is greatly appreciated.

Reply
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
Close Windows Media Player Cordell Excel Discussion (Misc queries) 1 January 30th 07 04:43 AM
Disable Close all Windows rjvega Excel Discussion (Misc queries) 1 November 7th 06 03:23 PM
Pop-up windows upon save &/or close C_F via OfficeKB.com Links and Linking in Excel 1 January 15th 06 07:08 PM
Is there a quick way to delete all duplicate rows in a column? Jellaby Excel Discussion (Misc queries) 3 May 16th 05 10:47 PM
excel - Windows close button (x) should only close active workboo. CoffeeAdict Setting up and Configuration of Excel 3 February 8th 05 04:30 AM


All times are GMT +1. The time now is 06:46 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"