Thread: Cell address
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Neil[_11_] Neil[_11_] is offline
external usenet poster
 
Posts: 43
Default Cell address

Myrna,

Thanks for that, I just had to change it a little for my data to update a
chart and I was using a single row.

Set rng1 = Range(Cells(userrow, 19), Cells(userrow, 22))
x = Application.Min(rng1)
x1 = Application.Max(rng1)
With rng1
Set c = .Find(x, LookIn:=xlValues)
Set c1 = .Find(x1, LookIn:=xlValues)
End With
MinX = ActiveSheet.Range(c.Address).Address
MaxX = ActiveSheet.Range(c1.Address).Address

Thanks
Neil

"Myrna Larson" wrote in message
...
In VBA? Assuming this is a 2-dim range rather than a single column or
single
row,

Set Rng1 = Range("A1:K22")
x = Application.Min(Rng1)
Set Rng2 = Rng1.Find(What:=x, After:=Rng1.Cells(Rng1.Cells.Count))
MsgBox Rng2.Address


On Sat, 06 Nov 2004 22:49:31 GMT, "Neil" wrote:

Hi!

How do I find the address of the cell that contains the minimum value in a
range.

Thanks in advance,

Neil