Help with a macro

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

Hi

Is there anybody who can help me to create a macro which
can do the next simple task :
In column f1:f60 on a current worksheet search for the
highest(maximal) value and highlight it with a color.

Any help is highly appreciated
 
Hi

Is there some reason you want to do this with macro instead conditional
formatting

For cell F1 - The formula is: f1=MAX($f$1:$f$60), celect the color when
comparision returns TRUE, and copy F1, and PasteSpecial.Formats to range
f1:f60
 
Hi Arvi

Your suggestion is a good idea but it doesn't work.
What do you mean with "PasteSpecial.Formats to range
f1:f60"?
I selected cell F1 then in format/Conditional
Format/"Formula is:" typed =max($F$1:$F$60) and changed
the pattern to green.
After that with fill-handle dragged from F1 to F60 as
result the value in all cells from F1 to F60 changed to
the value of cell F1 and they all are colored in green. I
also tried to use Format Painter to copy the format of
cell F1 in this case the value in cells F1:f60 is correct
(doesn't changes) but they all are colored in green.

I need to highlight only the cell with highest value not
all cells in the range F1:f60.

Paul


Your
 
Meanwhile I checked some web sites and found a formula
which does exactly what I needed.
The Formula is: =AND(ISNUMBER($F1),$F1>=LARGE
($F$1:$F$200,4)) and works perfect
when you copy it with Format Painter to highlight the 4
highest values in the range F1:F200.

Thank you any way for trying helping me.

Paul
 
Hi


Paul said:
Hi Arvi

Your suggestion is a good idea but it doesn't work.
What do you mean with "PasteSpecial.Formats to range
f1:f60"?

Select the cell and copy it.
Select the range F1:F60
From menu select Edit
From Edit menu select Paste Special
In Paste Special window, check Formats and press OK.

I selected cell F1 then in format/Conditional
Format/"Formula is:" typed =max($F$1:$F$60) and changed

You had to type
=F1=max($F$1:$F$60)
or even better
=(F1=max($F$1:$F$60))
 
Back
Top