View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Derivation of min and max values

the object Cell holds the information at the time when it colors the cell.

Sub MarkTheCells()
Dim rng as Range, rng1 as Range
Dim l as Double, s as Double
Dim cell as Range
set rng = range("A1").Resize(96,64)
rng.interior.ColorIndex = xlNone
l = application.Large(rng,10)
s = application.Small(rng,10)
for each cell in rng
if isnumeric(cell) and _
not isempty(cell) and cell.Text < "" then
if cell.Value = l then
cell.interior.colorIndex = 5
cell.Select
msgbox "Large Cell found at " & cell.Address
elseif cell.Value<= s then
cell.Interior.colorIndex = 3
cell.Select
msgbox "Small Cell found at " & cell.Address
end if
end if
Next
End Sub

the select and msgbox are for example since I don't know what you want to do
with the information.

--
Regards,
Tom Ogilvy



"bandy2000" wrote in message
...
Thanks Tom,
that was what I was looking for. I made the necessary changes for my case
and it worked instantly.
When this Sub found a Cell to be within the top 10. How can I dereive the
information in which Cell this happened?

"Bob Phillips" wrote:

But I never believe them :-)

Been bitten too many times.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"OJ" wrote in message
ups.com...
Hi,
he did say that every cell had data in...

Every cell in this field contains data.

OJ