A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

hide rows with zero balance



 
 
Thread Tools Display Modes
  #1  
Old July 23rd 07, 05:24 PM posted to microsoft.public.excel.programming
andresg1975
external usenet poster
 
Posts: 60
Default hide rows with zero balance

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

Ads
  #2  
Old July 23rd 07, 05:34 PM posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default hide rows with zero balance

On 23 Jul, 17:24, andresg1975 >
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

  #3  
Old July 23rd 07, 06:00 PM posted to microsoft.public.excel.programming
andresg1975
external usenet poster
 
Posts: 60
Default hide rows with zero balance

It didn't work due to a syntax error in he
If WorksheetFunction.Sum(rngHide.Offset(0, 1).Resize(1, 5)) = 0


" wrote:

> On 23 Jul, 17:24, andresg1975 >
> 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
>
>

  #4  
Old July 25th 07, 08:36 PM posted to microsoft.public.excel.programming
andresg1975
external usenet poster
 
Posts: 60
Default hide rows with zero balance

Thanks a lot for your help!

" 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.
>
>

 




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I automatically hide or suppress zero balance rows zhehol Excel Worksheet Functions 1 June 14th 06 03:43 AM
How do I Add rows to a Balance sheet BillyBoy Excel Discussion (Misc queries) 1 January 12th 06 04:24 AM
Insert Rows in Balance Sheet Template Teacher_Becky New Users to Excel 2 November 21st 05 02:15 AM
How do i keep a running balance without adding rows each time? park Excel Worksheet Functions 1 August 14th 05 10:37 AM
How to hide values in a running balance untill new data is entere. doggydog Excel Discussion (Misc queries) 1 March 9th 05 05:58 AM


All times are GMT +1. The time now is 01:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.