high and low value in a cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know how to show the high value and low value of a cell that
is showing the trade by trade of a stock.
 
It depends on how your data is organized. To get the minimum or maximum of a
range, you can use:

=min(a1:a100)
=max(a1:a100)

If your data is organized some other way, let us know.
 
One way:
'The low number is shown in B1, the high in C1. The changing cell is A1.
'Put 1000000 in B1 and "0" in C1 to begin
Private Sub Worksheet_Change(ByVal Target As Range)
If IsEmpty(Target) Then Exit Sub
If Target.Address(0, 0) = "A1" Then
If Target.Value < [B1].Value Then [B1].Value = Target.Value
If Target.Value > [C1] Then [C1].Value = Target.Value
End If
End Sub
HTH Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top