Worsheet selection

C

Cesar

How can I select worksheets based on the value of a cell? The value in this
cell is alphanumeric. Let's say in Sheet1 I have a cell named GRADE and the
value on this cell could be 61026H, 61042, 69026S, etc. if the GRADE value is
61026H select Sheet2, if it is 61042 select, Sheet3, etc. But if, let's say
the GRADE is 61042 the selected Sheet would it be Sheet3 and then the GRADE
value change on Sheet1 to 61026H we should select Sheet2.

Thanks for the help
Cesar
 
D

Dave Peterson

You've gotten several replies to your previous thread. But the requirements
keep changing. You had some responses where the sheet names weren't the same as
the value you typed into the cell.

And you had some responses where the value typed in was the same as name of the
sheet to go to.

I don't understand one of those responses didn't help.
 
C

Cesar

Dave,
Thanks for your comments,
Yes in effect I have several replies but I'm still stuck with my problem.
The description of the problem still the same, even if the Sheet names are
the same of the GRADE value or not. My problem, and problably I'm not good
describing it, as I stated this time, if GRADE is, let's say, 61026H then
the code that you gave me effectively selects the Sheet2 named 61026H, but if
the GRADE value changes to, let's say 61042, my workbook stays in Sheet2
(61026H) and never selects Sheet3 (named now 61042), What I found out to
make it work is going back and select the cell GRADE doble-click and Enter,
then the Sheet#(61042) is selected.
The code works the first time when I open the Workbook but if the the value
of GRADE changes, it never changes the Sheet selected.
Does it make sense to you?
Thanks and I apologize for insisting on this.
 
D

Dave Peterson

How is the value changing in the cell named Grade?

If it's changing because the user typed something in, then the other code should
work.

If the value changes because of a calculation, then you could use a different
worksheet event. But that would scare the heck out of me. Why would I want to
change sheets whenever that cell's formula evaluated to something different.
 
C

Cesar

OK, we produce paper and that GRADE is the name or code of the paper being
produced, we produced a roll of paper about every hour and we can be
producing the same paper for several hours or days, in other words, let's say
we can produced the paper 61042 for 14 hrs, then we change product and
produce the paper 61026H for 36 hrs, etc. On every roll of paper produced we
performed several quality tests, with different names (MOISTURE, MULLEN,
STFI, etc). All this information (GRADE, MOISTURE, MULLEN, STFI, etc) along
with the date/time when the roll was produced, is stored in a SQL database.
Using MS Query, I am extracting the data from the data base and use it to
create some charts with limits, and targets. I am refreshing the data
retrieved every 30 min. So the way I did it is in the Sheet1 I retrieve the
data from the SQL database using some filters (=today()-1), and pull all the
paper roll information (GRADE, MOISTURE, MULLEN, STFI, etc). I named Sheet2 =
61026H, Sheet3 = 61042, etc. and built on each one, the correspondent charts
with the limits and targets that belong to that particular GRADE. So what I
want the code to do is to select the Sheet that corresponds to the GRADE
being retrieved from the Database and if that GRADE changes select the Sheets
according to the GRADE value.
So basically, the value GRADE is changed whenever we change the type of
paper produced, is not a user entry or a product of a calculation.

Thanks
 

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

Top