Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate sheet names in a listbox
when i pick a workbook from a file dialog box (auomatically) i need
to display all the sheets(name) present in that workbook in a listbox from which i have to select and do some operations .... hope this is possible in vba .... |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate sheet names in a listbox
The code below assumes you have a listbox on the worksheet that was added from the Toolbars - Forms Sub test() fileToOpen = Application _ .GetOpenFilename("Excel Files (*.xls), *.xls") If fileToOpen = False Then MsgBox ("Cannot Open file - Exiting Macro") Exit Sub End If For Each sht In Sheets ActiveSheet.ListBoxes("List Box 2").AddItem sht.Name Next sht End Sub -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=150774 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate sheet names in a listbox
Where is the listbox?
Phil Hibbs. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate sheet names in a listbox
Is this for workbooks that are already open or for workbooks that are closed?
If they're already open, you could loop through each of the workbooks. Myrna Larson and Bill Manville's compare program does this: http://www.cpearson.com/excel/whatsnew.htm look for compare.xla If it's for processing closed workbooks, I'd have to loop through all the workbooks in the folder (and subfolder???) and then open each--then loop through the worksheets in each workbook, then close the workbook. vicky wrote: when i pick a workbook from a file dialog box (auomatically) i need to display all the sheets(name) present in that workbook in a listbox from which i have to select and do some operations .... hope this is possible in vba .... -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populate an array with sheet names? | Excel Programming | |||
Populate Excel Userform with Sheet names | Excel Programming | |||
populate combobox with sheet names | Excel Programming | |||
populate combobox with sheet names | Excel Programming | |||
Populate cell values with sheet names | Excel Programming |