Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default programming font color on select items

hello,

I obviously have a prob :)

I am wanting the program to look through a row (range) and pick out the
lowest value if it meets the condition set, then, apply color to the
font.
Sounds easy enough, but I keep getting errors.. Can anyone point out
what i've done wrong?? I'll attach a snippet of the code.

Another question.. after the font is colored in certain cells.. can i
get the program to recalculate an average(mean) without looking at the
cells with colored font? is there a way to get it to ignore those
cells?

Thanks alot.. your help is always gratefully appreciated!

(BY the way, this code is in a loop, that's why there are variables
like j and k.

Iwill want it to go and apply font color to all the cells that dont
meet the criteria of tlowgrubb, so i suppose i should have it loop
back and recalculate a new tlow without the one that it just made
green.

If tlow grubb Then
lowval = Application.WorksheetFunction.Min(Range("D" &
J + K, "N" & J + K))
lowval.Font.Color = RGB(0, 200, 0)
End If



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default programming font color on select items

grubb = Cells(J + K, "V").value
tlow = Cells(J + K, "T").value
thigh = Cells(J + K, "U").value
If tlow grubb Then
lowval = Application.WorksheetFunction.Min(Range("D" &
J + K, "N" & J + K)) 'finds minimum value in row of data
Cells(Range("D" & J + K, "N" & J +
K)).value(lowval).Font.Color = RGB(0, 255, 0) 'supposed to
shade font of the minimum value, but cannot get it to do this.
End If

I still havent quite got the right format. but i've included a bit more
code to clarify the variables to some extent. Any suggestions as to
what i'm doing wrong?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default programming font color on select items

Dim rng as Range

grubb = Cells(J + K, "V").value
tlow = Cells(J + K, "T").value
thigh = Cells(J + K, "U").value
If tlow grubb Then
set rng = Range("D" & J + K, "N" & J + K)

lowval = Application.WorksheetFunction.Min(rng) 'finds minimum value in
row of data
res = application.Match(lowval,rng,0)
if not iserror(res) then
rng(1,res).Font.Color = RGB(0, 255, 0)
End If

--
Regards,
Tom Ogilvy

"chick-racer" wrote in message
...
grubb = Cells(J + K, "V").value
tlow = Cells(J + K, "T").value
thigh = Cells(J + K, "U").value
If tlow grubb Then
lowval = Application.WorksheetFunction.Min(Range("D" &
J + K, "N" & J + K)) 'finds minimum value in row of data
Cells(Range("D" & J + K, "N" & J +
K)).value(lowval).Font.Color = RGB(0, 255, 0) 'supposed to
shade font of the minimum value, but cannot get it to do this.
End If

I still havent quite got the right format. but i've included a bit more
code to clarify the variables to some extent. Any suggestions as to
what i'm doing wrong?



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Why font color change back to black when I select a different cell Cody Excel Worksheet Functions 1 March 2nd 10 07:35 AM
programming to select rows based on condition Farhad Excel Discussion (Misc queries) 4 January 14th 10 01:18 AM
=COUNTIF(range, select items highlighted with specific color) AA Excel Worksheet Functions 2 September 29th 09 05:28 PM
Conditional Format for font color using font color Jim Excel Worksheet Functions 2 August 29th 09 11:54 AM
Changing Font color based on font type or size John Excel Discussion (Misc queries) 2 February 7th 08 12:50 AM


All times are GMT +1. The time now is 09:43 PM.

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

About Us

"It's about Microsoft Excel"