LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default list of opened workbooks and selection

Valeria,

You may want to modify Patrick's code so as to avoid
hidden workbooks and the workbook containing the code, viz.

For Each wb In Workbooks
If wb.Windows(1).Visible And wb.Name <
ThisWorkbook.Name Then
ComboBox1.AddItem wb.Name
End If
Next wb

Kevin Beckham

-----Original Message-----
if you put a combobox onto a userform, you can populate
it like this:

Option ExplicitPrivate Sub UserForm_Initialize()
Dim wb As Workbook
ComboBox1.AddItem "Select Workbook..."
For Each wb In Workbooks
ComboBox1.AddItem wb.Name
Next
ComboBox1.ListIndex = 0
End Sub
Private Sub cmdOK_Click()
If ComboBox1.ListIndex = 0 Then Exit Sub
'process workbook
End Sub

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Dear experts,
I have written a macro that works on the active

workbook.
I would like instead to get a list of the opened

workbooks
in Excel, and be able to select one (maybe through an
inputbox?) on which the macro has to work.
Is this possible?
Many thanks!
Kind regards,
Valeria
.

.

 
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
Filter multiple workbooks from drop down list selection mellors Excel Worksheet Functions 1 July 18th 10 04:09 PM
History of Workbooks opened derek Excel Worksheet Functions 1 May 20th 09 05:55 PM
Troubleshoot links - both workbooks have to be opened? JoyceM Excel Discussion (Misc queries) 0 February 7th 07 10:29 PM
always prompted to save opened workbooks kjbrr Excel Discussion (Misc queries) 2 July 31st 06 08:10 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


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