Populate a list box with all active workbooks except the current o
How about something like this. When the userform is activated it populates
the list box...
Private Sub UserForm_Activate()
Dim wbk As Workbook
ListBox1.Clear 'Change the list box name as necessary
For Each wbk In Workbooks
If wbk.Name < ThisWorkbook.Name Then _
ListBox1.AddItem wbk.Name
Next wbk
End Sub
--
HTH...
Jim Thomlinson
"travis" wrote:
Hi,
I'm not sure how to go about this one...
I want a listbox control in a userform launched from
spreadsheetone.xls to display the names of all the other
spreadsheets. i.e. the user can select any workbook in the open
workbooks collection, but spreadsheetone.xls won't be in that list
(because the form is part of an exporting routine to copy charts and
tables from spreadsheetone.xls to a new worksheet in whichever open
workbook the user selects).
How do I put the names of all open workbooks into a listbox?
Travis
|