skyrockettes2
New Member
- Joined
- Jun 29, 2012
- Messages
- 12
Hi there,
I have a data file ranging from B8 until AI77 (headers from B7:AI7), in case each cell in a row is zero or blank (e.g. B8=C8=D8=E8:AI8= 0) the row needs to be hidden. A sum function cannot be used, since I have both positive and negative values in the cells.
Furthermore, columns H, O, V and AC always have blanks. The cells in the other columns are either zero or any possible number (positive or negative). So basically, if in a row there's somewhere a cell that contains a number other than zero, it needs to remain visible. Otherwise, it can be hidden.
[TABLE="class: grid, width: 500, align: center"]
<TBODY>[TR]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[TD]
[/TR]
[TR]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
[/TR]
[TR]
[TD]
[TD="align: center"]0[/TD]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
[TD="align: center"][/TD]
[TD]
[TD]
[/TR]
[TR]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
[/TR]
[TR]
[TD]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
[/TR]
[TR]
[TD]
[TD]
[TD]
[TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
[/TR]
</TBODY>[/TABLE]
In this case only row 10 should be hidden.
Is there anyone who can help me with a macro? I would really appreciate your time and effort! Many thanks!
FYI, I'm using Excel 2007, I don't know if that matters...
I have a data file ranging from B8 until AI77 (headers from B7:AI7), in case each cell in a row is zero or blank (e.g. B8=C8=D8=E8:AI8= 0) the row needs to be hidden. A sum function cannot be used, since I have both positive and negative values in the cells.
Furthermore, columns H, O, V and AC always have blanks. The cells in the other columns are either zero or any possible number (positive or negative). So basically, if in a row there's somewhere a cell that contains a number other than zero, it needs to remain visible. Otherwise, it can be hidden.
[TABLE="class: grid, width: 500, align: center"]
<TBODY>[TR]
[TD]
Row/Column
[/TD][TD]
B
[/TD][TD]
C
[/TD][TD]
D
[/TD][TD]
E
[/TD][TD]
F
[/TD][TD]
G
[/TD][TD]
H
[/TD][TD]
I
[/TD][TD]
J
[/TD][/TR]
[TR]
[TD]
8
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
-2
[/TD][TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
0
[/TD][/TR]
[TR]
[TD]
9
[/TD][TD="align: center"]0[/TD]
[TD]
1
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
-1
[/TD][TD="align: center"][/TD]
[TD]
2
[/TD][TD]
0
[/TD][/TR]
[TR]
[TD]
10
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
0
[/TD][/TR]
[TR]
[TD]
12
[/TD][TD]
6
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD]
1
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
3
[/TD][/TR]
[TR]
[TD]
13
[/TD][TD]
2
[/TD][TD]
2
[/TD][TD]
-4
[/TD][TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"][/TD]
[TD="align: center"]0[/TD]
[TD]
0
[/TD][/TR]
</TBODY>[/TABLE]
In this case only row 10 should be hidden.
Is there anyone who can help me with a macro? I would really appreciate your time and effort! Many thanks!
FYI, I'm using Excel 2007, I don't know if that matters...
Last edited: