View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default Recording maximum and minimum

Put the following code in the Worksheet module:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count = 1 Then
If Target = Cells(2, 2) Then
If Cells(2, 2) Cells(3, 2) Then
Cells(3, 2) = Cells(2, 2)
End If
If Cells(2, 2) < Cells(4, 2) Then
Cells(4, 2) = Cells(2, 2)
End If
End If
End If
End Sub

RBS

"F" wrote in message
...
I have a spreadsheet in which a value is automatically imported into B2
each day.

I would like B3 to automatically show the maximum value ever reached in B2
and, in B4, the minimum ever reached by B2. Could someone advise me on how
I might do this please.

TIA.

--
F
(Beware of spam trap - remove the negative)