ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet Labels as Combo Box Selections (https://www.excelbanter.com/excel-programming/407057-worksheet-labels-combo-box-selections.html)

pdberger

Worksheet Labels as Combo Box Selections
 
Good afternoon --

I would like to set up a combo box using the labels of the worksheets as the
options from which the user selects. So, if I had a contiguous set of
worksheets -- Smith, Jones, Thompson, for example -- how could I do that?

Can anyone help with how to do that?

Thanks in advance.

reklamo

Worksheet Labels as Combo Box Selections
 
If you are using a UserForm and a ComboBox in the UserForm assign the
following macro to the user form:

Private Sub UserForm_Initialize()
For Each ws In ActiveWorkbook.Worksheets
ComboBox1.AddItem ws.Name
Next
End Sub

regards
reklamo




"pdberger" wrote:

Good afternoon --

I would like to set up a combo box using the labels of the worksheets as the
options from which the user selects. So, if I had a contiguous set of
worksheets -- Smith, Jones, Thompson, for example -- how could I do that?

Can anyone help with how to do that?

Thanks in advance.



All times are GMT +1. The time now is 12:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com