highest number

H

Hannes

Hi,

Let's keep the problem simple.
I have one cell that uses an exchange rate from the internet.
That cell changes every minute.

What I want to do:
In an other cell, I want to keep the highest exchange rate ever.

So for example:

6:00 exchange rate = 5.00 -- highest exchange rate is 5.00
6:01 exchange rate = 4.98 -- highest exchange rate is 5.00
6:02 exchange rate = 5.02 -- highest exchange rate is 5.02
6:03 exchange rate = 5.01 -- highest exchange rate is 5.02
6:04 exchange rate = 5.03 -- highest exchange rate is 5.03

Of course nor for any minute I use a new cell, it just change the
number
How can I achieve this.

Hannes
 
D

Don Guillett

Right click sheet tab>view code>insert this.
Now, if you change k1 and it is higher than k2>k2 will change to the higher
figure
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("K1")) Is Nothing Then Exit Sub
If Target.Value > Range("k2").Value Then Range("k2").Value = Target

End Sub
 

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

Top