Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default hit counter question

Hi
Occurs to me that this may not work with a DDE link, but might require
a manual change of the cell value.
You might need to add the relevant code after the link changes the
values in A1 and B1. Do you have access to that code so that it can be
edited?
Paul

(Paul Robinson) wrote in message . com...
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
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
Counter Mubarak Excel Discussion (Misc queries) 1 December 21st 09 05:34 PM
Counter Sdbenn90 Excel Discussion (Misc queries) 4 January 9th 06 11:43 AM
Counter donny Excel Programming 1 February 24th 04 05:35 PM
Counter Mark D[_4_] Excel Programming 0 July 17th 03 12:39 AM
Counter Don Guillett[_4_] Excel Programming 0 July 17th 03 12:30 AM


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