Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hit counter question
I need a hit counter on Excel 2003 which counts the number of times a
condition is met. This spreadsheet DDEs to RediPlus (trading software). The DDE fields would be "last price" and "day high price". When last = day high, I have it flash a green conditional format. What I would like to do is to not only flash green but also count the number of times last = day high. For example, A1 = DDE link to "last price" of IBM (constantly changing) B1 = DDE link to "day high price" of IBM (changes only when a new high is made otherwise stays the same) C1 = alert if they equal (IBM is making a new high) - flashes green via condiitional format I would like to put a hit counter in C1 that only increases when last = day high Seems simple, but I just can't get it to work Thanks Bob |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
hit counter question
Hi
have a look at http://www.mcgimpsey.com/excel/accumulator.html for creating an accumulator (you may use a different event, e.g. worksheet_calculate instead of worksheet_change) P.S.: also please don't multipost as this scatters your answers and create additional effort for all who answer to your questions -- Regards Frank Kabel Frankfurt, Germany Bob Chapman wrote: I need a hit counter on Excel 2003 which counts the number of times a condition is met. This spreadsheet DDEs to RediPlus (trading software). The DDE fields would be "last price" and "day high price". When last = day high, I have it flash a green conditional format. What I would like to do is to not only flash green but also count the number of times last = day high. For example, A1 = DDE link to "last price" of IBM (constantly changing) B1 = DDE link to "day high price" of IBM (changes only when a new high is made otherwise stays the same) C1 = alert if they equal (IBM is making a new high) - flashes green via condiitional format I would like to put a hit counter in C1 that only increases when last = day high Seems simple, but I just can't get it to work Thanks Bob |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
hit counter question
Hi Bob,
Put this in the code module behind the sheet your values are on (Open up the Visual Basic Editor, identify your workbook in the project window and double click the appropriate sheet). Note that format changes on a sheet do not trigger this event. Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("a1:b1")) Is Nothing Then If Range("A1").Value = Range("B1").Value Then Range("C1").Value = Range("C1").Value + 1 End If End If End Sub regards Paul "Bob Chapman" wrote in message news:<7yw1c.25539$UU.21881@lakeread01... I need a hit counter on Excel 2003 which counts the number of times a condition is met. This spreadsheet DDEs to RediPlus (trading software). The DDE fields would be "last price" and "day high price". When last = day high, I have it flash a green conditional format. What I would like to do is to not only flash green but also count the number of times last = day high. For example, A1 = DDE link to "last price" of IBM (constantly changing) B1 = DDE link to "day high price" of IBM (changes only when a new high is made otherwise stays the same) C1 = alert if they equal (IBM is making a new high) - flashes green via condiitional format I would like to put a hit counter in C1 that only increases when last = day high Seems simple, but I just can't get it to work Thanks Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Counter | Excel Discussion (Misc queries) | |||
Counter | Excel Discussion (Misc queries) | |||
Counter | Excel Programming | |||
Counter | Excel Programming | |||
Counter | Excel Programming |