View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default VBA code to hide blank rows

You can do this by applying autofilter to column B and select Non-
blanks from the filter pull-down. It's not dynamic, though, so if
something changes to make one of the blank cells into a value then you
will need to re-apply the filter condition.

Hope this helps.

Pete

On Jul 31, 1:10*pm, ub wrote:
Hi
The data in my sheet is in the below mentioned format.

* * * * Column B
1 * * * <Blank
2 * * * <Blank
3 * * * <Blank
4 * * * <Blank
5 * * *Total * *
6 * * * * * 2
7 * * * * * 4
8 * * * * * 6
9 * * * * * * * <Blank *
10 * Total * * * * 12
I need to write a VBA code to hide rows that are blank and subsquently the
row that has field "Total"
Ex: Rows 1,2,3,4 are blank , so their "Total"-Row#5 is blank, so I need to
hide all these 5 rows.
In rows 6 to 10, row#9 is blank. So in this range, I need to hide only row # 9
I need to write a code that will satify both condition in a given range.

Please advise
Thanks