Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how do i list all the sheet tab names in the current workbook in listbox1?
the listbox1 is on userform1 thanx |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Put in the UserForm Initialize event code.
For Each sh In ActiveWorkbook.Sheets If Not sh.Name Is Nothing Then UserForm1.ListBox1.AddItem sh.Name End If Next Untested. "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i get error msg "object required" what should go after the next?
thank you "JLGWhiz" wrote: Put in the UserForm Initialize event code. For Each sh In ActiveWorkbook.Sheets If Not sh.Name Is Nothing Then UserForm1.ListBox1.AddItem sh.Name End If Next Untested. "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
something like this might work Private Sub UserForm_Initialize() Dim WS As Worksheet For Each WS In Worksheets Listbox1.AddItem WS.Name Next End Sub regards FSt1 "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
that worked...
now can i get a this to run when a user click on commandbutton1 sub comandbutton1_click if nothing in listbox1 selected then msgbox "please select month" else call savetosheet end sub "FSt1" wrote: hi something like this might work Private Sub UserForm_Initialize() Dim WS As Worksheet For Each WS In Worksheets Listbox1.AddItem WS.Name Next End Sub regards FSt1 "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi
i assumed that it would be part of the forms initialization but it would be easy enought just to swith Sub UserForm_Initialize() to sub commandbutton1_click() or just add it to code you may already have in commandbutton1. Regards FSt1 "pswanie" wrote: that worked... now can i get a this to run when a user click on commandbutton1 sub comandbutton1_click if nothing in listbox1 selected then msgbox "please select month" else call savetosheet end sub "FSt1" wrote: hi something like this might work Private Sub UserForm_Initialize() Dim WS As Worksheet For Each WS In Worksheets Listbox1.AddItem WS.Name Next End Sub regards FSt1 "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i added this following
With Me.ListBox1 .MultiSelect = fmMultiSelectMulti .ListStyle = fmListStyleOption End With "FSt1" wrote: hi something like this might work Private Sub UserForm_Initialize() Dim WS As Worksheet For Each WS In Worksheets Listbox1.AddItem WS.Name Next End Sub regards FSt1 "pswanie" wrote: how do i list all the sheet tab names in the current workbook in listbox1? the listbox1 is on userform1 thanx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating listbox with sheet names | Excel Discussion (Misc queries) | |||
How do I get a list from an excel sheet into a userform/listbox? | Excel Programming | |||
Generate sheet names from list, assign data to summary sheet. | Excel Programming | |||
get a list of sheet names onto a listbox on a form | Excel Programming | |||
ListBox with hidden and visible sheet names? | Excel Programming |