View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dgephri Dgephri is offline
external usenet poster
 
Posts: 7
Default how can I hide rows when a field is blank?

looks simple enough, remaining questions:
1. new to loop index counters. Can I nest them for certain Row Ranges
(B...F, H...L, M...Q, etc.?)
2. do I just paste this in as a VB macro, save the function, and make it
work on startup?

"Rick Rothstein (MVP - VB)" wrote:

To hide Row 5 (on Sheet1) when B5 is blank (that is, when it has nothing in
it, not simply when it is zero)...

With Worksheets("Sheet1")
If .Cells(5, "C").Value = "" Then .Cells(5, "C").EntireRow.Hidden = True
End With

You can run a loop for the rows of interest substituting your loop index
counter in for the hard-coded 5's used above.

Rick


"Dgephri" wrote in message
...
How can I hide Row 5 when Cell B5 is blank, and likewise for all rows in
the
table? Tried pasting from another thread here into the VB macro page, and
I
must have missed something in the process.

General layout:
B5 checks if loan balance 0, then populates B5 with Borrower name. Other
B
row cells all check if B5"" and then populate their functions.
But since loans get paid off, I don't want my front master sheet to get
overrun with all the old information, even though I don't want to delete
the
history there...

Much thanks from a long time user of another spreadsheet, changing old
stuff
over to Excel.