Microsoft Office Forums


Reply
Thread Tools Display Modes

hide rows with zero balance

 
 
andresg1975
Guest
Posts: n/a
 
      07-23-2007, 04:24 PM
i have, lets say
a b c d
1 1 4 5 9
2 8 0 8 7
3 0 0 0 0
4 7 8 5 9
5 0 0 0 0
6 5 8 7 4

how can i hide rows where column a,b,c and d have zero balances
In this case, hiding row 3 and 5
Any help would be greatly appreciated

 
Reply With Quote
 
 
 
 
Toyin.Butler@googlemail.com
Guest
Posts: n/a
 
      07-23-2007, 04:34 PM
On 23 Jul, 17:24, andresg1975 <andresg1...@discussions.microsoft.com>
wrote:
> i have, lets say
> a b c d
> 1 1 4 5 9
> 2 8 0 8 7
> 3 0 0 0 0
> 4 7 8 5 9
> 5 0 0 0 0
> 6 5 8 7 4
>
> how can i hide rows where column a,b,c and d have zero balances
> In this case, hiding row 3 and 5
> Any help would be greatly appreciated



Try this for where your data is in cells B1 to E7:


Dim rngHide As Range

For Each rngHide In Range("A2:A7")
If WorksheetFunction.Sum(rngHide.Offset(0, 1).Resize(1, 5)) = 0
Then
rngHide.EntireRow.Hidden = True
End If
Next rngHide



Regards,

Toyin

 
Reply With Quote
 
 
 
 
andresg1975
Guest
Posts: n/a
 
      07-23-2007, 05:00 PM
It didn't work due to a syntax error in here:
If WorksheetFunction.Sum(rngHide.Offset(0, 1).Resize(1, 5)) = 0


"(E-Mail Removed)" wrote:

> On 23 Jul, 17:24, andresg1975 <andresg1...@discussions.microsoft.com>
> wrote:
> > i have, lets say
> > a b c d
> > 1 1 4 5 9
> > 2 8 0 8 7
> > 3 0 0 0 0
> > 4 7 8 5 9
> > 5 0 0 0 0
> > 6 5 8 7 4
> >
> > how can i hide rows where column a,b,c and d have zero balances
> > In this case, hiding row 3 and 5
> > Any help would be greatly appreciated

>
>
> Try this for where your data is in cells B1 to E7:
>
>
> Dim rngHide As Range
>
> For Each rngHide In Range("A2:A7")
> If WorksheetFunction.Sum(rngHide.Offset(0, 1).Resize(1, 5)) = 0
> Then
> rngHide.EntireRow.Hidden = True
> End If
> Next rngHide
>
>
>
> Regards,
>
> Toyin
>
>

 
Reply With Quote
 
Toyin.Butler@googlemail.com
Guest
Posts: n/a
 
      07-24-2007, 08:01 AM
The syntax is due to you not having "Then" after the 0

For some reason the text has wrapped to the next line in my reply.

Let me know,

Toyin.

 
Reply With Quote
 
andresg1975
Guest
Posts: n/a
 
      07-25-2007, 07:36 PM
Thanks a lot for your help!

"(E-Mail Removed)" wrote:

> The syntax is due to you not having "Then" after the 0
>
> For some reason the text has wrapped to the next line in my reply.
>
> Let me know,
>
> Toyin.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Varying cell ranges in formulas according to number of cells with certain value Dranoeler Excel Worksheets 1 05-20-2013 11:15 AM
Cutting copy to the clipboard with wildcards OLY Word Documents 0 05-19-2013 10:02 PM
VBA help with selecting multiple data ranges Kc001 Excel Programming 1 05-16-2013 07:13 AM
how do I automatically hide or suppress zero balance rows zhehol Excel Worksheets 1 06-14-2006 02:43 AM
opening balance - closing balance Greg Access General 3 05-16-2004 11:47 AM


All times are GMT. The time now is 04:03 PM.
Microsoft Office Forums is not affiliated with Microsoft Corporation.


Welcome!
Welcome to the Microsoft Office Forums
 


Latest Threads
Mail Merging Content With High Quality
oleander (04-17-2014, 11:59 PM)

Aargh. What is this?
PeteJ (04-17-2014, 12:10 PM)

Word 2013 Insert Symbol (Not Responding)
tpthrshr (04-17-2014, 02:49 AM)

Can't save a large Word document
Josh (04-17-2014, 01:03 AM)

Remote help?
newman200 (04-13-2014, 12:54 PM)