Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Highlighting (formatting) 4 lowest cells in a named range to differntcolor

Hi all,
I have a line of code in a macro that reads as follows
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00")
This code finds the average of the 4 smallest values in the range and
formats the result as currency. Works fine.
What I would like to do is use a similiar line of code that would
highlight those values in the worksheet.
I am thinking of something like:
Format("SMALL(my_rng,{1,2,3,4})", "Color = 49407")
but I get sytax error with this. thks in advance for any help.
BRC
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default Highlighting (formatting) 4 lowest cells in a named range todiffernt color

I think you'll have to look at each cell in that my_rng and see if the value in
each is among the smallest 4 values.

Or maybe you could just apply conditional formatting using that rule.

If A1:A10 is my_rng, then you could select A1:A10 and use a conditional format
rule like:

=a1<=small(my_rng,4)



On 08/09/2010 15:56, BRC wrote:
Hi all,
I have a line of code in a macro that reads as follows
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00")
This code finds the average of the 4 smallest values in the range and
formats the result as currency. Works fine.
What I would like to do is use a similiar line of code that would
highlight those values in the worksheet.
I am thinking of something like:
Format("SMALL(my_rng,{1,2,3,4})", "Color = 49407")
but I get sytax error with this. thks in advance for any help.
BRC


--
Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Highlighting (formatting) 4 lowest cells in a named range todiffernt color

On Aug 9, 6:20*pm, Dave Peterson wrote:
I think you'll have to look at each cell in that my_rng and see if the value in
each is among the smallest 4 values.

Or maybe you could just apply conditional formatting using that rule.

If A1:A10 is my_rng, then you could select A1:A10 and use a conditional format
rule like:

=a1<=small(my_rng,4)

On 08/09/2010 15:56, BRC wrote:

Hi all,
I have a line of code in a macro *that reads as follows
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00")
This code finds the average of the 4 smallest values in the range and
formats the result as currency. Works fine.
What I would like to do is use a similiar line of code that would
highlight those values in the worksheet.
I am thinking of something like:
Format("SMALL(my_rng,{1,2,3,4})", "Color = 49407")
but I get sytax error with this. thks in advance for any help.
BRC


--
Dave Peterson


After reading my own post i realized i left out a portion of the line
i am using as a model. that should read: myval =
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00". What i
am trying to do is conditional formatting on these same 4 cells in
code. Thanks for suggestions
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 834
Default Highlighting (formatting) 4 lowest cells in a named range to differnt color

Doesn't change the solution, as posted by Dave, one iota that I can see.

--

HTH

Bob
"BRC" wrote in message
...
On Aug 9, 6:20 pm, Dave Peterson wrote:
I think you'll have to look at each cell in that my_rng and see if the
value in
each is among the smallest 4 values.

Or maybe you could just apply conditional formatting using that rule.

If A1:A10 is my_rng, then you could select A1:A10 and use a conditional
format
rule like:

=a1<=small(my_rng,4)

On 08/09/2010 15:56, BRC wrote:

Hi all,
I have a line of code in a macro that reads as follows
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00")
This code finds the average of the 4 smallest values in the range and
formats the result as currency. Works fine.
What I would like to do is use a similiar line of code that would
highlight those values in the worksheet.
I am thinking of something like:
Format("SMALL(my_rng,{1,2,3,4})", "Color = 49407")
but I get sytax error with this. thks in advance for any help.
BRC


--
Dave Peterson


After reading my own post i realized i left out a portion of the line
i am using as a model. that should read: myval =
Format(Evaluate("=AVERAGE(SMALL(my_rng,{1,2,3,4})) "), "0.00". What i
am trying to do is conditional formatting on these same 4 cells in
code. Thanks for suggestions


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Highlighting the lowest cell automatically Frances Holden Excel Discussion (Misc queries) 1 January 7th 08 02:48 PM
Conditional formatting and Highlighting Date Range [email protected] Excel Discussion (Misc queries) 0 July 18th 07 04:15 PM
Conditional formatting and Highlighting Date Range [email protected] Excel Discussion (Misc queries) 0 July 18th 07 04:14 PM
I need to return the lowest time value in a range of cells. al elkins Excel Worksheet Functions 2 January 26th 07 06:24 AM
inserting a named range into new cells based on a named cell Peter S. Excel Discussion (Misc queries) 1 June 4th 06 03:53 AM


All times are GMT +1. The time now is 06:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"