vba code on autofilter

U

ub

Hi
I have range of cell from b2:g40 and I want to hide the the rows if any of
the cells in the range is blank.
Example: if any of the cells in row 2 from b2 to g2 is not blank, i want to
display the row#2. but suppose if all the cells in range b2 to g2 are blank,
I want to hide the row #2
I want to go this for 40 rows.
Can you please advise some VBA code on this
 
G

Gary''s Student

You don't need vba, just a helper column. In H2, enter:

=IF(COUNTBLANK(B2:G2)=6,1,0) and copy down

a value of 1 means that all the cells from B2 to G2 are blanks. Just
AutoFilter on column H to hide all the 1's
 

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