Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Functions Expert..four (4) different colors if a specific conditi

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value A thru E I need
red, if its a F thru J then blue, K thru O then green, P thru T
then yellow.

Im struggling with the set up of this requirement.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Functions Expert...four (4) different colors if a specific conditi

Which version are you using? In Excel 2007 you can do this but in previous
version you can only use 3 conditions, so if that's the case you need VBA

--
Regards,

Peo Sjoblom


"JVANWORTH" wrote in message
...
I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P thru
T"
then yellow.

I'm struggling with the set up of this requirement.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Functions Expert..four (4) different colors if a specific conditi

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value A thru E I need
red, if its a F thru J then blue, K thru O then green, P thru T
then yellow.

Im struggling with the set up of this requirement.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Functions Expert..four (4) different colors if a specific con

Mike H,

I'm sure this works, but my ability is limited in where to put. How do I
insert this into the work sheet. I need direction in order to execute.

"Mike H" wrote:

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value A thru E I need
red, if its a F thru J then blue, K thru O then green, P thru T
then yellow.

Im struggling with the set up of this requirement.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Functions Expert...four (4) different colors if a specific con

What is VBA

"Peo Sjoblom" wrote:

Which version are you using? In Excel 2007 you can do this but in previous
version you can only use 3 conditions, so if that's the case you need VBA

--
Regards,

Peo Sjoblom


"JVANWORTH" wrote in message
...
I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P thru
T"
then yellow.

I'm struggling with the set up of this requirement.






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Functions Expert...four (4) different colors if a specific con

Select the sheet where you want this to happen.
Right click on the sheet tab
Select View Code
This will open the VBE
Paste the code into the right side of the window that opens
ALT+Q to close the VBE and return to Excel

Biff

"JVANWORTH" wrote in message
...
Mike H,

I'm sure this works, but my ability is limited in where to put. How do I
insert this into the work sheet. I need direction in order to execute.

"Mike H" wrote:

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P
thru T"
then yellow.

I'm struggling with the set up of this requirement.



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Functions Expert...four (4) different colors if a specific con

Here's a tip:

If you have an event macro like this that formats a cell *NEVER* select the
entire sheet and then click the "clear formats" button on your toolbar (if
you have that button on one of your toolbars). You will regret it!

Biff

"T. Valko" wrote in message
...
Select the sheet where you want this to happen.
Right click on the sheet tab
Select View Code
This will open the VBE
Paste the code into the right side of the window that opens
ALT+Q to close the VBE and return to Excel

Biff

"JVANWORTH" wrote in message
...
Mike H,

I'm sure this works, but my ability is limited in where to put. How do I
insert this into the work sheet. I need direction in order to execute.

"Mike H" wrote:

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P
thru T"
then yellow.

I'm struggling with the set up of this requirement.





  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Functions Expert...four (4) different colors if a specific con

Thanks.......I'll give it a go

"T. Valko" wrote:

Here's a tip:

If you have an event macro like this that formats a cell *NEVER* select the
entire sheet and then click the "clear formats" button on your toolbar (if
you have that button on one of your toolbars). You will regret it!

Biff

"T. Valko" wrote in message
...
Select the sheet where you want this to happen.
Right click on the sheet tab
Select View Code
This will open the VBE
Paste the code into the right side of the window that opens
ALT+Q to close the VBE and return to Excel

Biff

"JVANWORTH" wrote in message
...
Mike H,

I'm sure this works, but my ability is limited in where to put. How do I
insert this into the work sheet. I need direction in order to execute.

"Mike H" wrote:

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P
thru T"
then yellow.

I'm struggling with the set up of this requirement.






  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Functions Expert...four (4) different colors if a specific con

Thanks Again.......I got it to work.

What do I need to change if I want it to recongnize whole words or
phrases...ie...
Eng 9, Math 9, Science 9 would be red
Eng 10, Math 10, Science 10 would be blue

I have four lists of courses in a worksheet that need to be highlighted
their respective color when entered.

Can you help?

Thanks in Advance,
John


"T. Valko" wrote:

Select the sheet where you want this to happen.
Right click on the sheet tab
Select View Code
This will open the VBE
Paste the code into the right side of the window that opens
ALT+Q to close the VBE and return to Excel

Biff

"JVANWORTH" wrote in message
...
Mike H,

I'm sure this works, but my ability is limited in where to put. How do I
insert this into the work sheet. I need direction in order to execute.

"Mike H" wrote:

try this:-

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) _
Is Nothing Then Exit Sub
Select Case Target.Value
Case "A" To "E"
icolor = 3
Case "F" To "J"
icolor = 41
Case "K" To "O"
icolor = 4
Case "P" To "T"
icolor = 6
Case Else
End Select
Target.Interior.ColorIndex = icolor
End Sub


"JVANWORTH" wrote:

I need a cell to change into four (4) different colors if a specific
condition is met. For example if A1 matches a text value "A thru E" I
need
"red", if it's a "F thru J" then "blue", "K thru O" then "green", "P
thru T"
then yellow.

I'm struggling with the set up of this requirement.




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
Functions expertnumbering random condition in a column JVANWORTH Excel Worksheet Functions 15 April 2nd 09 01:25 AM
can i set font colors in functions Jamie Excel Worksheet Functions 5 May 17th 07 07:03 PM
changing colors of font in functions andreee Excel Worksheet Functions 1 January 2nd 06 12:13 PM
Adding cells with specific colors spanishjon Excel Discussion (Misc queries) 3 July 25th 05 10:27 AM
How do i keep the colors applied to the specific rows when sor Crowraine Excel Discussion (Misc queries) 4 February 1st 05 06:23 AM


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