Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Hru48
 
Posts: n/a
Default Conditional Formating


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: http://www.excelforum.com/member.php...o&userid=24895
View this thread: http://www.excelforum.com/showthread...hreadid=507247

  #2   Report Post  
Posted to microsoft.public.excel.misc
DaveO
 
Posts: n/a
Default Conditional Formating

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.


"Hru48" wrote:


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: http://www.excelforum.com/member.php...o&userid=24895
View this thread: http://www.excelforum.com/showthread...hreadid=507247


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Install dates formating using conditional formating? Jerry Eggleston Excel Discussion (Misc queries) 2 November 9th 05 05:49 PM
Conditional formating using formulas arifnj Excel Worksheet Functions 4 October 27th 05 01:56 PM
can i freeze conditional formating to copy to another worksheet Chris Lane Excel Discussion (Misc queries) 1 October 12th 05 06:53 PM
VLOOKUP & Conditional Formating Help. Excel'ed Failures Excel Discussion (Misc queries) 6 August 16th 05 04:46 PM
more than 3 conditional formating in excel Manan Excel Discussion (Misc queries) 2 February 7th 05 09:12 PM


All times are GMT +1. The time now is 02:28 PM.

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

About Us

"It's about Microsoft Excel"