sswcharlie
03-04-2015, 12:14 AM
Hi
Another option to my earlier post. Will give me a couple of options to choose from.
With code below it asks 'object required' In line starting with 'For Each...
Option Compare Text
Sub test()
ComboBox1.Clear
For Each Sheet In Sheets 'object required on this line
If InStr(Sheet.Name, "Site#") > 0 Then
ComboBox1.AddItem (Sheet.Name)
End If
Next
End Sub
Private Sub ComboBox1_Change()
If ComboBox1.Text <> "" Then
Sheets(ComboBox1.Text).Select
End If
End Sub
Have ComboBox1 on Sheet1. Code in 'Worksheet'
What am I missing ?
Thankyou
CharlesHarris
Another option to my earlier post. Will give me a couple of options to choose from.
With code below it asks 'object required' In line starting with 'For Each...
Option Compare Text
Sub test()
ComboBox1.Clear
For Each Sheet In Sheets 'object required on this line
If InStr(Sheet.Name, "Site#") > 0 Then
ComboBox1.AddItem (Sheet.Name)
End If
Next
End Sub
Private Sub ComboBox1_Change()
If ComboBox1.Text <> "" Then
Sheets(ComboBox1.Text).Select
End If
End Sub
Have ComboBox1 on Sheet1. Code in 'Worksheet'
What am I missing ?
Thankyou
CharlesHarris