ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Hide/unhide sheet macro based on cell calculation (https://www.excelbanter.com/excel-programming/330198-hide-unhide-sheet-macro-based-cell-calculation.html)

Greg Fisher

Hide/unhide sheet macro based on cell calculation
 
I have a spreadsheet that calculates regions in the US. Based on a user
input of city, state I have a lookup that return the region. Each worksheet
ties to the region (ie Region 01) that is returned from the user input. I
created another lookup in case there are multiple returns of the region,
where I have a column that retuns only unique regions. THis is where I need
a macro that will unhide the sheet if the region is named. I have tried
other code from this website, however, it is event enabled and requires a
direct input. Is there something that will work off calculations?

Tom Ogilvy

Hide/unhide sheet macro based on cell calculation
 
The calculate event is associated with calculations, but isn't specific to a
given cell.

But it seems like the changing of a cell would trigger the calculate, so why
not the change event?

--
Regards,
Tom Ogilvy

"Greg Fisher" wrote in message
...
I have a spreadsheet that calculates regions in the US. Based on a user
input of city, state I have a lookup that return the region. Each

worksheet
ties to the region (ie Region 01) that is returned from the user input.

I
created another lookup in case there are multiple returns of the region,
where I have a column that retuns only unique regions. THis is where I

need
a macro that will unhide the sheet if the region is named. I have tried
other code from this website, however, it is event enabled and requires a
direct input. Is there something that will work off calculations?




Greg Fisher

Hide/unhide sheet macro based on cell calculation
 
I do not understand why this does not work. I have changed the value of cell
C3 directly, and the macro works. If I have a reference in another sheet to
cell C3 and chage it on the other sheet, it will not work when the
spreadsheet calcs and updates cell C3. For some reason, the macro does not
run.


"Tom Ogilvy" wrote:

The calculate event is associated with calculations, but isn't specific to a
given cell.

But it seems like the changing of a cell would trigger the calculate, so why
not the change event?

--
Regards,
Tom Ogilvy

"Greg Fisher" wrote in message
...
I have a spreadsheet that calculates regions in the US. Based on a user
input of city, state I have a lookup that return the region. Each

worksheet
ties to the region (ie Region 01) that is returned from the user input.

I
created another lookup in case there are multiple returns of the region,
where I have a column that retuns only unique regions. THis is where I

need
a macro that will unhide the sheet if the region is named. I have tried
other code from this website, however, it is event enabled and requires a
direct input. Is there something that will work off calculations?





Tom Ogilvy

Hide/unhide sheet macro based on cell calculation
 
Change only triggers on a physical edit in this type of situation. You
would need to use the change event where you actually make the change.

--
Regards,
Tom Ogilvy


"Greg Fisher" wrote in message
...
I do not understand why this does not work. I have changed the value of

cell
C3 directly, and the macro works. If I have a reference in another sheet

to
cell C3 and chage it on the other sheet, it will not work when the
spreadsheet calcs and updates cell C3. For some reason, the macro does

not
run.


"Tom Ogilvy" wrote:

The calculate event is associated with calculations, but isn't specific

to a
given cell.

But it seems like the changing of a cell would trigger the calculate, so

why
not the change event?

--
Regards,
Tom Ogilvy

"Greg Fisher" wrote in message
...
I have a spreadsheet that calculates regions in the US. Based on a

user
input of city, state I have a lookup that return the region. Each

worksheet
ties to the region (ie Region 01) that is returned from the user

input.
I
created another lookup in case there are multiple returns of the

region,
where I have a column that retuns only unique regions. THis is where

I
need
a macro that will unhide the sheet if the region is named. I have

tried
other code from this website, however, it is event enabled and

requires a
direct input. Is there something that will work off calculations?








All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com