Cost Spreadsheets

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In a cost spreadsheet, how do you remove rows and columns that do not have dollars entered so that when it prints, it only prints the rows and columns with dollars attributed to them. I would rather not have to hide each row. I worked at a place that when I pressed the control and C keys at the same time, it automatically dumped the rows with 0.00 amounts in them and made a clean report. Do I have to change a macro or something?
 
Ken

This code will hide rows where column B contains blanks or zeros.

Adjust to suit.

Sub HideBlank_Zeros_Rows()
'using set column
Dim RngCol As Range
Dim i As Range
Set RngCol = Range("B1", Range("B" & Rows.Count). _
End(xlUp).Address)
For Each i In RngCol
If i.Value = "" Or i.Value = "0" Then _
i.EntireRow.Hidden = True
Next i
End Sub

Gord Dibben Excel MVP
 
-----Original Message-----
In a cost spreadsheet, how do you remove rows and columns
that do not have dollars entered so that when it prints,
it only prints the rows and columns with dollars
attributed to them. I would rather not have to hide each
row. I worked at a place that when I pressed the control
and C keys at the same time, it automatically dumped the
rows with 0.00 amounts in them and made a clean report.
Do I have to change a macro or something?
Whenever I'm doing any cost work, I never put non-
financial details into rows when the column under has
financials just because I did once and rolled a quantity
into the totals and looked like a fool. In other words,
if you are applying a percentage or quantity, I always
runs those in separate columns and then hide. I usually
apply all that detail in one or two columns, then hide. I
know you don't like the hide option, but I've found it
best for data continuity and eliminating the opportunity
for pulling in into a formula when undesired.
 
Back
Top