passing a comboxbox result into sheets.select
Thank you....i wasn't sure how much of the code I should put in the post...but
all of you answered my question.
It works great!
"lcifers" wrote:
Try this:
'In the change event of your combobox
Private Sub ComboBox1_Change()
If Not Me.ComboBox1.Value = "" Then
Sheets(Me.ComboBox1.Value).Select
End If
End Sub
'To load sheet names when initializing the form
Private Sub UserForm_Initialize()
Dim s As Excel.Worksheet
For Each s In ThisWorkbook.Worksheets
Me.ComboBox1.AddItem s.Name
Next
End Sub
HTH.
- Luther
|