vba code on autofilter

  • Thread starter Thread starter ub
  • Start date Start date
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
 
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
 
Back
Top