Hide rows when specified columns equal zero

H

Han123

I have a spreadsheet which is an accounting balance sheet. With the exception
of the top 3 rows and column A all the data in the sheet is looked up from a
seperate piece of software (it uses the data in column A and Rows 1-3 to look
up the data). The data is within B7:F123.
I would like to write a macro to hide all rows where column A is not blank
but columns C, D, E, F all equal zero or are blank. It is important that if A
is blank the line should never be hidden.
The rows that are blank will change overtime and so each time the macro is
run it needs to unhide rows that no longer fulfil the criteria and hide any
that do.

Any help would be much appreciated. If anyone is writing a response please
be warned I am a novice with VB.

Many Thanks
 
M

Max

Autofiltering on a helper col would provide the core functionality that you
seek
Put a label in G6, eg: Key
Place in G7:
=IF(AND(A7<>"",SUMPRODUCT(((C7:F7="")+(C7:F7=0)))),"","x")
Copy G7 down to cover the max expected extent of data, say down to G200?
Select G6:G200, apply autofilter, then just choose "x" from the droplist in
G6. That would give you the exact results that you seek, ie hiding all data
rows where:
.. where column A is not blank
but columns C, D, E, F all equal zero or are blank

---
 

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