Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Sheet names in a form dropdown

Hi I have created a form and I would like to have a drop down on the form
populated with the names of each sheet in my workbook (Other than the sheet
named "Menu")

Can someone tell me how to do this.

Thanks

Rob



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Sheet names in a form dropdown


"Rob Hargreaves" schrieb im Newsbeitrag
...
Hi I have created a form and I would like to have a drop down on the form
populated with the names of each sheet in my workbook (Other than the
sheet named "Menu")

Can someone tell me how to do this.

Thanks

Rob


Hi rob,

try the following in the Initialize event of your form

Private Sub UserForm_Initialize()
Dim mySheet As Worksheet
For Each mySheet In Worksheets
If mySheet.Name < "Menu" Then

myDropDownCtrlName.AddItem mySheet.Name

End If
Next
End Sub


Stephan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 692
Default Sheet names in a form dropdown

Here's something I use with the worksheet activate...

Private Sub Worksheet_Activate()
Dim cell As Range, ws As Worksheet
Application.ScreenUpdating = False
Dim x As Integer
With ActiveSheet
.ListBox1.Clear
x = 1
For Each ws In ActiveWorkbook.Worksheets

If ws.Name < "Index" Then
.ListBox1.AddItem ws.Name
Cells(x, 1) = ws.Name
x = x + 1
End If
Next
End With
Range("a1").Select
Application.ScreenUpdating = True
End Sub

--
steveB

Remove "AYN" from email to respond

Remove "AYN" from email to respond
"Rob Hargreaves" wrote in message
...
Hi I have created a form and I would like to have a drop down on the form
populated with the names of each sheet in my workbook (Other than the
sheet named "Menu")

Can someone tell me how to do this.

Thanks

Rob




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Sheet names in a form dropdown

Rob,

If you are talking about a userform try adding this to the Initialize event.
Change Combobox1 to your Combobox name.

For Each wksheet In Worksheets
ComboBox1.AddItem wksheet.Name
Next

If this is a worksheet form you will need to create a range containing a
list of all the worksheet names and set the ListFillRange property of the
Dropdown box to that range.

HTH,
Matt









"Rob Hargreaves" wrote:

Hi I have created a form and I would like to have a drop down on the form
populated with the names of each sheet in my workbook (Other than the sheet
named "Menu")

Can someone tell me how to do this.

Thanks

Rob




Reply
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
User Form with dropdown item Gene Augustin Excel Discussion (Misc queries) 0 February 18th 09 06:35 PM
How do I set up a form with a dropdown linked to another sheet? Roy Bernal Setting up and Configuration of Excel 2 October 15th 08 12:52 AM
Widening Names Dropdown (Bob) John[_88_] Excel Programming 4 March 23rd 05 06:03 PM
Use dropdown list from Form Gerrym Excel Discussion (Misc queries) 1 January 4th 05 01:24 PM
Sheets Name into array for form dropdown Al Excel Programming 2 July 12th 04 06:52 AM


All times are GMT +1. The time now is 05:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"