#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Easy one...


I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below the
value found in I5

is there an 'on calculate' command?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Easy one...


Use conditional formating on the worksheet. Change setting to Cell Value
Less than and put I5 in the value box.

"John" wrote:

I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below the
value found in I5

is there an 'on calculate' command?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Easy one...


J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below
the
value found in I5

is there an 'on calculate' command?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Easy one...


I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below
the
value found in I5

is there an 'on calculate' command?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Easy one...


assuming V5 gets data after I5, maybe you could use the worksheet's change
event...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("V5").Address Then
If Range("V5") < Range("I5") Then
Range("J5").Value = "STOP"
Range("J5").Interior.Color = vbRed
End If
End If
End Sub

or just add the if check to whatever code you're running to pull in the data

"John" wrote in message
...
I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use
a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is
below
the
value found in I5

is there an 'on calculate' command?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Easy one...


I can't get it to run no matter what values are in my cells... code looks
perfect to me... where should I paste it?

"Patrick Molloy" wrote:

assuming V5 gets data after I5, maybe you could use the worksheet's change
event...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("V5").Address Then
If Range("V5") < Range("I5") Then
Range("J5").Value = "STOP"
Range("J5").Interior.Color = vbRed
End If
End If
End Sub

or just add the if check to whatever code you're running to pull in the data

"John" wrote in message
...
I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use
a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is
below
the
value found in I5

is there an 'on calculate' command?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Easy one...


the sheet's code page - so right click the tab and select View Code from the
pop-up

"John" wrote in message
...
I can't get it to run no matter what values are in my cells... code looks
perfect to me... where should I paste it?

"Patrick Molloy" wrote:

assuming V5 gets data after I5, maybe you could use the worksheet's
change
event...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("V5").Address Then
If Range("V5") < Range("I5") Then
Range("J5").Value = "STOP"
Range("J5").Interior.Color = vbRed
End If
End If
End Sub

or just add the if check to whatever code you're running to pull in the
data

"John" wrote in message
...
I don't want the cell to change back if the value goes back above the
set
value in I5... I want it to trigger and stay "STOP" so I don't want to
use
a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is
below
the
value found in I5

is there an 'on calculate' command?


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Easy one...


Right click the tab at the bottom of the worksheet that you want to have
this functionality, select View Code from the popup menu that appears and
copy/paste the code into the code window that opened up.

--
Rick (MVP - Excel)


"John" wrote in message
...
I can't get it to run no matter what values are in my cells... code looks
perfect to me... where should I paste it?

"Patrick Molloy" wrote:

assuming V5 gets data after I5, maybe you could use the worksheet's
change
event...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("V5").Address Then
If Range("V5") < Range("I5") Then
Range("J5").Value = "STOP"
Range("J5").Interior.Color = vbRed
End If
End If
End Sub

or just add the if check to whatever code you're running to pull in the
data

"John" wrote in message
...
I don't want the cell to change back if the value goes back above the
set
value in I5... I want it to trigger and stay "STOP" so I don't want to
use
a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is
below
the
value found in I5

is there an 'on calculate' command?



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Easy one...


Maybe a modified formula, again with conditional formatting:

=IF(J5="STOP","STOP",IF(V5<I5,"STOP",""))

This way, if J5 is already "STOP", it will stay that way. If it starts out
as blank, then it will only go to "STOP" when V5 becomes less than I5.

HTH,

Eric

"John" wrote:

I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below
the
value found in I5

is there an 'on calculate' command?



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Easy one...


....although I think I just created somewhat of a circular reference. The
only way to reset that cell's (J5) value after "STOP" is triggered is to
either modify the formula or to have a "Reset" button that resets the value
to blank.

"EricG" wrote:

Maybe a modified formula, again with conditional formatting:

=IF(J5="STOP","STOP",IF(V5<I5,"STOP",""))

This way, if J5 is already "STOP", it will stay that way. If it starts out
as blank, then it will only go to "STOP" when V5 becomes less than I5.

HTH,

Eric

"John" wrote:

I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below
the
value found in I5

is there an 'on calculate' command?




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Easy one...


Something like this:

Private Sub CommandButton1_Click()
ActiveSheet.Cells(5, 10).Value = ""
ActiveSheet.Cells(5, 10).Formula =
"=IF(J5=""STOP"",""STOP"",IF(V5<I5,""STOP"","""")) "
End Sub


"EricG" wrote:

...although I think I just created somewhat of a circular reference. The
only way to reset that cell's (J5) value after "STOP" is triggered is to
either modify the formula or to have a "Reset" button that resets the value
to blank.

"EricG" wrote:

Maybe a modified formula, again with conditional formatting:

=IF(J5="STOP","STOP",IF(V5<I5,"STOP",""))

This way, if J5 is already "STOP", it will stay that way. If it starts out
as blank, then it will only go to "STOP" when V5 becomes less than I5.

HTH,

Eric

"John" wrote:

I don't want the cell to change back if the value goes back above the set
value in I5... I want it to trigger and stay "STOP" so I don't want to use a
formula

"Patrick Molloy" wrote:

J5: =IF(V5<I5,"STOP","")

and set conditional formatting when J5 value ="STOP"

"John" wrote in message
...
I have a sheet that updates from an external feed...

I want to change cell J5 to "STOP" and format it RED if cell V5 is below
the
value found in I5

is there an 'on calculate' command?


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
Easy one..not for me.. Rogie Excel Discussion (Misc queries) 1 February 13th 07 10:23 AM
Should be easy Michell Major Excel Discussion (Misc queries) 8 November 27th 06 12:50 PM
How to sum in an easy way? [email protected] Excel Discussion (Misc queries) 7 April 20th 06 02:38 PM
Probably easy but I need help! djbob2k2 Excel Worksheet Functions 1 September 19th 05 01:44 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM


All times are GMT +1. The time now is 10:11 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"