ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing text in other cells (https://www.excelbanter.com/excel-programming/320358-changing-text-other-cells.html)

Excel ProgrammingMe

Changing text in other cells
 
I'd like the text in one cell to change if the value
of another cell becomes negative. How can I get that to
happen?

JulieD

Changing text in other cells
 
Hi

something along the lines of

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1")) Is Nothing Then
If Target.Value < 0 Then
Range("b1").Value = "a1 is negative"
Else
Range("b1").Value = "a1 is positive"
End If
End If
End Sub

---
this needs to go in the sheet module of the sheet that you working on (right
mouse click on the sheet tab, choose view code & paste the code there)

Hope this helps
Cheers
JulieD

"Excel ProgrammingMe" <Excel wrote
in message ...
I'd like the text in one cell to change if the value
of another cell becomes negative. How can I get that to
happen?




Tom Ogilvy

Changing text in other cells
 
=if(A1<1,"A1 is negative","Non Negative Text")

--
Regards,
Tom Ogilvy


"Excel ProgrammingMe" <Excel wrote
in message ...
I'd like the text in one cell to change if the value
of another cell becomes negative. How can I get that to
happen?




Debra Dalgleish

Changing text in other cells
 
In the cell where the text should appear, you can use an IF formula. For
example:

=IF(B2<0,"Value is negative","Value is positive")

Excel ProgrammingMe wrote:
I'd like the text in one cell to change if the value
of another cell becomes negative. How can I get that to
happen?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html


Tom Ogilvy

Changing text in other cells
 
Of course the 1 should be a zero

=if(A1<0,"A1 is negative","Non Negative Text")

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
=if(A1<1,"A1 is negative","Non Negative Text")

--
Regards,
Tom Ogilvy


"Excel ProgrammingMe" <Excel

wrote
in message ...
I'd like the text in one cell to change if the value
of another cell becomes negative. How can I get that to
happen?







All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com