Creating a function to auto hide rows

R

Robert G.

Hello,

I want to have a function that will look for a value ( 1 or 0 ) and based on
that hide the current row. The value of "1", or "0" is being based off if
there is a name in a cell at the end of the database I have.

Example:

B1 (the name cell)
X1 (the name display cell, if database criteria is met)
Y1 (Where the value will be determined: If(B1=X1,1,0 )
Z1 (this is where the Hiderow function will go. If Y1=1, leave row
displayed, if Y1=0, hide row)

This is the perfect form, But I need the Hiderow function to hide the
current row and, the two rows bellow it. I used some merged and none merged
cells, so multiple row hide are needed.

Thanks for any help you can give me.
 
G

Gord Dibben

Functions return values..............they cannot hide rows.

You need event code to do that.

Also, if the row is hidden, how will the computed value in Y1 ever get
changed?

Is there a computed value in X1 also? Referencing what?

Will you want the code to run on a range of rows?


Gord Dibben MS Excel MVP
 

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