I currently have a workbook consisting of sheets named after a series of storage locations. I am also using a form with a combobox to select a location, which I then hope to use as the value to select a worksheet.
Can I write something like this?
[vba]
If Trim (Me.cboLocation.text) = "" Then
Me.cboLocation.setFocus
MsgBox "Please enter a Location"
Exit Sub
Else
If Trim(Me.cboLocation.text) = "Commodity Shed" Then
Sheet ("Commodity Shed").Select
Sheet("Commodity Shed").Activate
Else
If Trim (Me.cboLocation.text) = "Turkey's Nest" Then
Sheet ("Turkey's Nest").Select
Sheet("Turkey's Nest").Activate
Else
If Trim(Me.cboLocation.text) = "West Q Alley" Then
Sheet ("West Q Alley").Select
Sheet ("West Q Alley").Activate
End If
End If
End If
End If
[/vba]
Will firstly select the sheet as indicated in the combo box and in turn will it then make it the active sheet?
Ted