![]() |
Selecting a sheet based on a cell
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 |
Selecting a sheet based on a cell
Private Sub ListBox1_Click()
Worksheets(ListBox1.Value).Activate End Sub Mike F "wilcster" wrote in message ... 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 |
Selecting a sheet based on a cell
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?? wilcster wrote: 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 |
Selecting a sheet based on a cell
Mike
Thats great - Many thanks Wilco. "Mike Fogleman" wrote: Private Sub ListBox1_Click() Worksheets(ListBox1.Value).Activate End Sub Mike F "wilcster" wrote in message ... 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 |
All times are GMT +1. The time now is 12:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com