View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default formula for stock quote

Hi
another way using VBA would be the use of the worksheet_change event.
Try the following code in your worksheet module:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub
On Error GoTo CleanUp
With Target
If .Value Me.Range("B1").value Then
Application.EnableEvents = False
Me.Range("B1").value = .value
end If
End With

CleanUp:
Application.EnableEvents = True
End Sub

Frank

I want to have my stock quotes updated to show the highest price the
stock has reached. I input the daily stock price in column A and I
want that checked against column B which shows the highest past
price. If the new input in column A is higher, I want that column B
changed automatically to reflect the new higher price. If the input
price in column A is not higher, I want column B to remain the same,
reflecting the older and higher price.
Everything I've tried on my own results in a circular error, even

when
I change the number of iterations and their parameters.
Answer to please
Thanks to any in advance
Edgar Coudal


---
Message posted from
http://www.ExcelForum.com/