Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tcgaines
 
Posts: n/a
Default If Cell Value < 0, Change Value to 0


The subject says it all. I want to search a range for cell values that
are < 0 and if they are, change the value to 0. how do i do that?

thx


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=496840

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
tcgaines
 
Posts: n/a
Default If Cell Value < 0, Change Value to 0


Solution:

Sub LessThanZero()
Dim cell As Range
'Change the worksheet and column values to suit your needs.
For Each cell In Range("Sheet1!A:A")
If cell.Value < 0 Then
cell.Value = 0
End If
Next
End Sub


--
tcgaines
------------------------------------------------------------------------
tcgaines's Profile: http://www.excelforum.com/member.php...o&userid=29608
View this thread: http://www.excelforum.com/showthread...hreadid=496840

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Govind
 
Posts: n/a
Default If Cell Value < 0, Change Value to 0

Hi,

You can write an IF formula like

=IF(A1<0,0,A1)

and copy it across the range.

Regards

Govind.

tcgaines wrote:

The subject says it all. I want to search a range for cell values that
are < 0 and if they are, change the value to 0. how do i do that?

thx


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
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
cell color change based on due date MINAL ZUNKE New Users to Excel 2 June 30th 05 09:24 PM
Cell Change Color - Need Help alani New Users to Excel 3 June 29th 05 03:50 PM
background color of my cell does not change Colorblinded Excel Discussion (Misc queries) 2 March 27th 05 04:55 PM
Look for change next blank cell in Range Nigel Bennett Excel Worksheet Functions 1 March 13th 05 09:45 PM


All times are GMT +1. The time now is 05:43 AM.

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

About Us

"It's about Microsoft Excel"