Remember Lowest Value in Cell

I

iamnu

Cell D3 contains a numeric value.

As data is changed in cell D3, I want cell G3 to keep track of the
lowest value that was entered in Cell D3.

How do I do this?

Thanks
 
D

Don Guillett

Right click sheet tab>view code>copy/paste this. Put a large value in d3 and
go from there

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$3" Then Exit Sub
lv = Range("g3")
If Target < lv Then Range("g3").Value = Target
End Sub
 
I

iamnu

Right click sheet tab>view code>copy/paste this. Put a large value in d3 and
go from there

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$3" Then Exit Sub
lv = Range("g3")
If Target < lv Then Range("g3").Value = Target
End Sub

Thank you sir, perfect!
 
D

Don Guillett

Glad to help

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Right click sheet tab>view code>copy/paste this. Put a large value in d3
and
go from there

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$3" Then Exit Sub
lv = Range("g3")
If Target < lv Then Range("g3").Value = Target
End Sub

Thank you sir, perfect!
 
C

Chip Pearson

If you want to avoid VBA and do it with a formula, you can use the
following in G3.

=IF(D3="",100,MIN(D3,G3))

This creates a circular reference (a formula referring to itself) so
you'll need to dismiss the "help" that Excel will provide and go to
the Tools menu, choose Options, then Calculation, and check the
Iterations option.

The 100 in the formula is used to initialize the "minimum" value. You
can change it to a value that will be greater than the actual minimum
is expected to be.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
The San Diego Project Group, LLC
(email is on the web site)
USA Central Daylight Time (-5:00 GMT)
 

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