Conditional Formating

H

Hru48

Hey,

Just a quick question - Is there a way to tell excel that if a cell =
then don't print.

I am trying to figure out a way of summing two columns together an
putting the result in a third column, when I don't know how many cell
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 kno
the amount of rows will be less then this.. but i still end up wit
alot of 0.

I know a DO ..until active cell is empty type loop would be bette
though i'm not sure how to work this..

cheers for any suggestion
 
D

DaveO

Your Do loop would look something like this...

Sub CalcSum()

dim intCounter as integer

Do while len(Range("A" & intCounter).Text) > 0 Or len(Range("B" &
intCounter).Text) > 0

range("C" & intCounter).Formula = "=A" & intCounter &"+B" & 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.
 
Top