Hey,
Just a quick question - Is there a way to tell excel that if a cell = 0
then don't print.
I am trying to figure out a way of summing two columns together and
putting the result in a third column, when I don't know how many cells
are populated everytime I do it.. its a monthly thing. I have a 'for'
loop so far where I have vaguly told it to sum up to 10000 as I know
the amount of rows will be less then this.. but i still end up with
alot of 0.
I know a DO ..until active cell is empty type loop would be better
though i'm not sure how to work this..
cheers for any suggestions--
Hru48
------------------------------------------------------------------------
Hru48's Profile: www.excelforum.com/member.php...oamp;userid=24895
View this thread: www.excelforum.com/showthread...hreadid=507247Your Do loop would look something like this...
Sub CalcSum()
dim intCounter as integer
Do while len(Range(quot;Aquot; amp; intCounter).Text) gt; 0 Or len(Range(quot;Bquot; amp;
intCounter).Text) gt; 0
range(quot;Cquot; amp; intCounter).Formula = quot;=Aquot; amp; intCounter amp;quot; Bquot; amp; intCounter
intCounter = intCounter 1
Loop
End Sub
This assumes that the 2 fields you want are in column A and B. If not simply
alter in the code above.
HTH.quot;Hru48quot; wrote:
gt;
gt; Hey,
gt;
gt; Just a quick question - Is there a way to tell excel that if a cell = 0
gt; then don't print.
gt;
gt; I am trying to figure out a way of summing two columns together and
gt; putting the result in a third column, when I don't know how many cells
gt; are populated everytime I do it.. its a monthly thing. I have a 'for'
gt; loop so far where I have vaguly told it to sum up to 10000 as I know
gt; the amount of rows will be less then this.. but i still end up with
gt; alot of 0.
gt;
gt; I know a DO ..until active cell is empty type loop would be better
gt; though i'm not sure how to work this..
gt;
gt; cheers for any suggestions
gt;
gt;
gt; --
gt; Hru48
gt; ------------------------------------------------------------------------
gt; Hru48's Profile: www.excelforum.com/member.php...oamp;userid=24895
gt; View this thread: www.excelforum.com/showthread...hreadid=507247
gt;
gt;
- Dec 25 Tue 2007 20:41
Conditional Formating
close
全站熱搜
留言列表
發表留言