View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Susan Susan is offline
external usenet poster
 
Posts: 1,117
Default Direct data tracking

this sub will run everytime the value in sheet 1, cell A1 changes. it
will add the new value to a list of cummulative values in sheet 2. as
for the high/low & percent change, you're on your own. :)
========================
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)

Dim mySheet As Worksheet
Dim myLastRow As Long
Dim c As Range

On Error GoTo myError

If Target = Range("A1") Then
Application.EnableEvents = False
Set mySheet = ActiveWorkbook.Worksheets(2)
myLastRow = mySheet.Cells(10000, 1).End(xlUp).Row + 1
Set c = mySheet.Range("a" & myLastRow)
c.Value = Target.Value
Application.EnableEvents = True
Else
Exit Sub
End If

myError:
Application.EnableEvents = True
Exit 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.

End Sub
=========================
hope it helps!
:)
susan



On Jul 29, 8:51*am, windbrit
wrote:
I have information coming into a cell within excel, this will update many
times a minute. I would like to keep track of these prices, highest price and
lowest price on the day and also a % change from the opening price.