View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ExcelMonkey[_159_] ExcelMonkey[_159_] is offline
external usenet poster
 
Posts: 1
Default Loading Sheet Names into Combo Box

So that works fine Tom. Now here is my next question. Suppose I no
want the result of the combo box to trigger another routine tha
selects that sheet that is chosen. That is I use the routine below t
load sheet names into a combo box. I now want this to trigger anothe
routine that selects the sheet.

I am not sure where to put this routine. I know that it has to go i
the sheet module. Do I pass the sheet names into an array and the
pass this array to another routine?

And lastly, I do not want this to run continuously. That is I want t
be able to pick a sheet name with the combo box, have it go to tha
sheet ONLY after the name has been chosen in the box. I guess I hav
to use the right "event" to make sure that the routine does not ru
continuously. Would this be the Change event?

How would you do this?

Thanks



'This loads the ComboBox list
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
End With

End Su

--
Message posted from http://www.ExcelForum.com