PC Review


Reply
Thread Tools Rate Thread

Combobox to list all Sheet Names How?

 
 
Corey
Guest
Posts: n/a
 
      21st Nov 2006
How can i set a Combobox displayed on a userform to list the current
workbook sheet names?


Corey....


 
Reply With Quote
 
 
 
 
Corey
Guest
Posts: n/a
 
      21st Nov 2006
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 With Quote
 
Jim Cone
Guest
Posts: n/a
 
      21st Nov 2006
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" <(E-Mail Removed)>
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 With Quote
 
Corey
Guest
Posts: n/a
 
      23rd Nov 2006
Thank you Jim.
Perfectly done....


ctm
"Jim Cone" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Loading sheet names in Combobox Bob Phillips Microsoft Excel Programming 0 16th Sep 2005 05:09 PM
populate combobox with sheet names David Goodall Microsoft Excel Programming 3 12th Sep 2004 12:37 PM
Re: populate combobox with sheet names David Goodall Microsoft Excel Programming 0 12th Sep 2004 08:55 AM
update combobox with sheet names Johnnyb Microsoft Excel Worksheet Functions 2 5th Jul 2004 10:45 AM
Populating sheet names in combobox Todd Huttenstine Microsoft Excel Programming 3 21st Dec 2003 12:11 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 AM.