Selecting a sheet based on a cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an worksheet used to input data which includes a drop down list with
subjects, lets say by way of example -types of animal. In other cells you can
input information about the subject from the drop down list. Further sheets
are named that reflect the names in the drop down list

I want to be able to select a worksheet based on the subject from the drop
down list using VBA.

At the moment I can readily select one sheet such as:

Worksheet("tiger").Activate

How do I substitute "tiger" for whatever is chosen on the input worksheet
cell drop down list????

Cheerz

Wilcster
 
Private Sub ListBox1_Click()
Worksheets(ListBox1.Value).Activate
End Sub

Mike F
 
Why not just keep an array of sheet names and look them up in there or
just a select case statement that converts the selection to a sheet name??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top