Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Combobox to list all Sheet Names How?

How can i set a Combobox displayed on a userform to list the current
workbook sheet names?


Corey....


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Combobox to list all Sheet Names How?

Ok found this code, but it does not seem to popiulate the combobox with
anything though??

Private Sub ComboBox1_Click()
Dim Sh As Worksheet
Dim sVal As String
With ComboBox1
sVal = .Text
Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < "Inputs" Then
AddItem Sh.Name
End If
Next
.Value = sVal
Worksheets(.Value).Activate
End With
End Sub

Any idea's

Corey....


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Combobox to list all Sheet Names How?

Private Sub ComboBox1_Click()
If Len(ComboBox1.Value) Then
Worksheets(ComboBox1.Value).Activate
End If
End Sub

Private Sub ComboBox1_DropButtonClick()
Dim Sh As Worksheet
With ComboBox1
.Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < "Inputs" Then
.AddItem Sh.Name
End If
Next
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Corey"
wrote in message
Ok found this code, but it does not seem to popiulate the combobox with
anything though??

Private Sub ComboBox1_Click()
Dim Sh As Worksheet
Dim sVal As String
With ComboBox1
sVal = .Text
Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < "Inputs" Then
AddItem Sh.Name
End If
Next
.Value = sVal
Worksheets(.Value).Activate
End With
End Sub

Any idea's
Corey....


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 276
Default Combobox to list all Sheet Names How?

Thank you Jim.
Perfectly done....


ctm
"Jim Cone" wrote in message
...
Private Sub ComboBox1_Click()
If Len(ComboBox1.Value) Then
Worksheets(ComboBox1.Value).Activate
End If
End Sub

Private Sub ComboBox1_DropButtonClick()
Dim Sh As Worksheet
With ComboBox1
.Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < "Inputs" Then
.AddItem Sh.Name
End If
Next
End With
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Corey"
wrote in message
Ok found this code, but it does not seem to popiulate the combobox with
anything though??

Private Sub ComboBox1_Click()
Dim Sh As Worksheet
Dim sVal As String
With ComboBox1
sVal = .Text
Clear
For Each Sh In ActiveWorkbook.Sheets
If Sh.Name < "Inputs" Then
AddItem Sh.Name
End If
Next
.Value = sVal
Worksheets(.Value).Activate
End With
End Sub

Any idea's
Corey....




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
Month Names as ComboBox List Abdul[_2_] Excel Programming 3 October 4th 06 10:00 AM
Loading sheet names in Combobox Sige Excel Programming 5 September 16th 05 05:09 PM
populate combobox with sheet names David Goodall Excel Programming 3 September 12th 04 12:37 PM
populate combobox with sheet names David Goodall Excel Programming 0 September 12th 04 08:55 AM
Populating sheet names in combobox Todd Huttenstine[_2_] Excel Programming 3 December 21st 03 12:11 AM


All times are GMT +1. The time now is 05:08 PM.

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

About Us

"It's about Microsoft Excel"