Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store peak cell value

Status
Not open for further replies.

nandina

Programmer
Joined
Feb 24, 2003
Messages
3
Location
AU
Hi there

I am not too familiar with excel - but am trying to retain the highest value of a single excel cell, which is coming into the spreadsheet from an external data source.

IF clause and MAX formula give errors as they cause a circular reference. How would you store the highest input value when referenced against itself as the new value comes in ? ie. a type of peak value recorder on a single cell value which is updated every 15 minutes.

Thanks in anticipation.

 
copy this into the sheeet change event in the vba editor...

change a2 to the cell the is linked to external data and d2 to a target cell of your choice.


Private Sub Worksheet_Change(ByVal Target As Range)
If Range("a2") > Range("d2") Then
Range("d2") = Range("a2")
Else
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top