[dba-Tech] Excel bloat question

Hale, Jim Jim.Hale at FleetPride.com
Wed May 16 17:24:11 CDT 2007


How about this for an article. I have a cashflow statement with many
accounts down (rows) and actual, prior year and plan across (columns). I
need to hide the rows that are 0 all the way across and, more
importantly, unhide rows that were zero but now have data. I always
forget to unhide the new rows which obviously creates
problems(accountants are anal about things adding). This will
automatically hide/unhide rows whenever the user activates the sheet.
:-)

Jim Hale


Private Sub Worksheet_Activate()
On Error GoTo Err_Process
Call HideRows("cashflownew", 14, 26, 4, 6)
The_End:
    
Exit Sub
Err_Process:
MsgBox "The following error occured: " & Error$
    Resume The_End
End Sub

Function HideRows(strWSheetname As String, intStartRow As Integer,
intEndRow As Integer, _
intStartCol As Integer, intEndCol As Integer, Optional intDecimalplaces
As Integer = 3)
Dim x As Integer, intFlag As Integer, y As Integer
Application.ScreenUpdating = False

 Worksheets(strWSheetname).Select
     For x = intStartRow To intEndRow
     intFlag = 0
       For y = intStartCol To intEndCol
            If Round(Cells(x, y).Value, intDecimalplaces) = 0 Then
                intFlag = 0 + intFlag
            Else
                intFlag = 1 + intFlag
            End If
       Next y
       If intFlag = 0 Then
            Rows(x).Hidden = True
        Else
            Rows(x).Hidden = False
        End If
    Next x
End Function

-----Original Message-----
From: dba-tech-bounces at databaseadvisors.com
[mailto:dba-tech-bounces at databaseadvisors.com] On Behalf Of Susan
Harkins
Sent: Wednesday, May 16, 2007 4:51 PM
To: 'Discussion of Hardware and Software issues'
Subject: Re: [dba-Tech] Excel bloat question


Jim, this was what I planned to write about. 

Jon, have you ever tried this? Anybody? I'm wondering what the
difference is between just deleting rows and columns and creating a new
sheet or workbook.


Susan H. 


I found this on the net:

Jim Hale

Honey Can I Shrink the Spreadsheet ? 

Rodney POWELL <mailto:rodney at beyondtechnology.com>
Microsoft MVP - Excel

_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com

***********************************************************************
The information transmitted is intended solely for the individual or
entity to which it is addressed and may contain confidential and/or
privileged material. Any review, retransmission, dissemination or
other use of or taking action in reliance upon this information by
persons or entities other than the intended recipient is prohibited.
If you have received this email in error please contact the sender and
delete the material from any computer. As a recipient of this email,
you are responsible for screening its contents and the contents of any
attachments for the presence of viruses. No liability is accepted for
any damages caused by any virus transmitted by this email.




More information about the dba-Tech mailing list