Thread: sheet select
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default sheet select

I assume that you have the combo box in a cell. Here is some code that will
do what you need.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
On Error Resume Next
Sheets(Target.Value).Select
End If
End Sub

It assumes that you combo box is in Cell A1. You can change that by changing:

Target.Address = "$A$1"

To add this code. Right Click on the worksheet tab that contains the combo
box. the last itme on the list is view code. Select View code and then just
paste this code in and you are off and running...

HTH


"scrabtree23" wrote:

I have sheet named "Tom", "Bill", and "Joe".

I have a useform with a combobox that has the options "Tom, Bill and Joe".
I want a code that will select the appropriate sheet depending on the cmbx
selection.