Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help Evaluating Cell Values and Changing Colors

I have a column B1 to B? with one of a possible 5 string
values in each cell. I wish to evaluate the value in the
B-cell and depending on that value is then change the
color of font in the corresponding cell in column C.

Note: B? means Column B is of variable length, could be
30 and next day could be 40.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help Evaluating Cell Values and Changing Colors

set rng = Range(Cells(1,2),Cells(rows.count,2).End(xlup))

for each cell in rng
Select Case Cell.Value
Case "string1"
cell.offset(0,1).Font.colorindex = 2
Case "string2"
cell.offset(0,1).Font.Colorindex = 5
. . .
Case Else
cell.Offset(0,1).Font.Colorindex = xlAutomatic
End Select
Next

make sure the case of your strings match or do

Select case lcase(cell.Value)

and have the constant strings as all lowercase.


Regards,
Tom Ogilvy


"ChrisG" wrote in message
...
I have a column B1 to B? with one of a possible 5 string
values in each cell. I wish to evaluate the value in the
B-cell and depending on that value is then change the
color of font in the corresponding cell in column C.

Note: B? means Column B is of variable length, could be
30 and next day could be 40.

Thanks in advance



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
Changing cell colors Joebeone Excel Discussion (Misc queries) 1 February 11th 10 07:17 PM
Cell colors or text color changing when date in cell gets closer. Chase Excel Worksheet Functions 5 October 19th 06 08:57 AM
Changing cell colors to correspond to different dates emtp6738 Excel Worksheet Functions 2 September 26th 06 02:40 AM
changing cell colors with formula sflcowboy78 Excel Worksheet Functions 2 October 2nd 05 01:19 AM
Cell contents changing colors Barmaley Excel Programming 0 July 8th 03 03:24 PM


All times are GMT +1. The time now is 06:50 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"