ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional statments. (https://www.excelbanter.com/excel-discussion-misc-queries/52614-conditional-statments.html)

Paul987

Conditional statments.
 

I have a cell that changes values, call it cell A1. What I want to
happen, is once A1 becomes 5000, I want B1 to do something. Doesn't
matter. Turn blue show "99999", I don't care. What matters is that it
needs to maintain that condition even if A1 once again becomes <5000.
This is why I can't get a formula or conditional formating to work,
because once if A1 becomes 5000 for a bit, and then changes to <5000,
the formatting disappears. Any Ideas?
Thanks

Paul


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=479918


Paul987

Conditional statments.
 

ps. I need to do this without a macro. Thanks,.


--
Paul987
------------------------------------------------------------------------
Paul987's Profile: http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=479918


swatsp0p

Conditional statments.
 

What you ask would require VBA (in a worksheet_change event). Do you
want to go that route?


--
swatsp0p


------------------------------------------------------------------------
swatsp0p's Profile: http://www.excelforum.com/member.php...o&userid=15101
View this thread: http://www.excelforum.com/showthread...hreadid=479918


Bob Phillips

Conditional statments.
 
Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "A1"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If .Value 5000 Then
.Offset(0, 1).ColorIndex = 5
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul987" wrote in
message ...

I have a cell that changes values, call it cell A1. What I want to
happen, is once A1 becomes 5000, I want B1 to do something. Doesn't
matter. Turn blue show "99999", I don't care. What matters is that it
needs to maintain that condition even if A1 once again becomes <5000.
This is why I can't get a formula or conditional formating to work,
because once if A1 becomes 5000 for a bit, and then changes to <5000,
the formatting disappears. Any Ideas?
Thanks

Paul


--
Paul987
------------------------------------------------------------------------
Paul987's Profile:

http://www.excelforum.com/member.php...o&userid=24850
View this thread: http://www.excelforum.com/showthread...hreadid=479918





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

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