Hide Blank Cells in Excel

I need to know how to hide blank cells in Excel 2007.  I have a created a simple workbook.  There are two worksheets in the workbook.  One worksheet (we'll call the worksheet "Data") contains data retrieved from a time management system.  The "Data" worksheet contains numerical values.  The second worksheet (we'll call it "Figures") contains two columns.  The first column consists of task numbers that are used for simple reference only.  The second column contains a SUMIF formula that looks to the "Data" worksheet - =SUMIF(Data!$D$1:$D$10000,"002 Review Job Plans ",Data!$G$1:$G$10000).  Since the majority of the cells are blank I need a simple way to hide them so that I can see only the cells that contain a numerical value greater than 0.  Note: some of the cells contain a formula that returns a value of 0 and some cells contain no formula.  Thank you for your help!    
calwood28Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

James ElliottManaging DirectorCommented:
Have you tried sorting the results?

Range(yourRange).Sort

There is no easy way to 'hide' individual cells...
0
krishnakrkcCommented:
Hi,

If you like VBA approach, then put this code in the 'Figures' sheet module.

Right click on Sheet name > View code  and paste the code there.

Close the VBE window. Now the code will fire when calculation happens.

Kris
0
krishnakrkcCommented:

Oops ! missed the code. Here you go.

Private Sub Worksheet_Calculate()

    Dim r As Range, k, i As Long, n As Long, a() As String, txt As String

    With Application
        .EnableEvents = False
        .ScreenUpdating = False
    End With

    Set r = Me.UsedRange.Columns("b:B") '<<=== adjust this column(blanks or Zeros)

    r.EntireRow.Hidden = False

    k = r

    On Error GoTo Xit
    If Not r Is Nothing Then
        For i = 1 To UBound(k, 1)
            If Len(k(i, 1)) = 0 Or k(i, 1) = 0 Then
                txt = txt & "," & "a" & i
                If Len(txt) > 245 Then
                    n = n + 1
                    ReDim Preserve a(1 To n)
                    a(n) = Mid$(txt, 2)
                    txt = vbNullString
                End If
            End If
        Next

        If Len(txt) > 1 Then
            n = n + 1
            ReDim Preserve a(1 To n)
            a(n) = Mid$(txt, 2)
            txt = vbNullString
        End If
        If n Then
            With r
                For i = 1 To n
                    .Range(CStr(a(i))).EntireRow.Hidden = True
                Next
            End With
        End If
    End If
Xit:
    With Application
        .EnableEvents = True
        .ScreenUpdating = True
    End With

End Sub

Kris
0
Arno KosterCommented:
You can manually apply filtering by adding a filter to the header rows, clicking it and specifying above 0 as criteria. Please note that this will also hide the task numbers related to tasks with numerical value less then or equal to zero.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.