Jeff
Here is a macro that will do what you want. I took the simple way out
and just summed the 3 cells in each row and if the sum is zero, hide the
row. This will not work with your data if you have the possibility of
positive and negative numbers summing up to zero. The code will hide such a
row and you don't want that row hidden. Come back if you see that problem
with your data and I'll come up with another way of doing it. I assumed
that you had data in Column A and that your data starts in row 2. HTH Otto
Sub HideIfDHI()
Dim rRngDHL1 As Range
Dim rColA As Range
Dim c As Long
Set rRngDHL1 = Range("D1,H1,L1")
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
Application.ScreenUpdating = False
For c = rColA.Count To 1 Step -1
If Application.Sum(rRngDHL1.Offset(c)) = 0 Then _
rColA(c).EntireRow.Delete
Next c
Application.ScreenUpdating = True
End Sub
Jeff
Yes, that is easy to do with VBA. However, Excel needs to know when you
want this to happen. Do you want to manually trigger a macro to look at
all
the rows and do what you want? Or do you want Excel to monitor Columns D,
H
and L, and check that row whenever the contents of any cell in Columns D,
H,
or L is changed? And when you say "0" do you mean that the cell is blank
( a zero value) or do you mean that the cell content is, in fact, the
- Show quoted text -
Hi Mate,
Thanks for your response. I chose to trigger the macro manually, i
will just create a button to call this macro.
Yes if the cell has a numerical value of zero. "im not sure if zero is
a numerical value though : )".
Thanks in advance.
cheers.
Jeff