#1   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing Row Color

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #3   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing Row Color

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Changing Row Color

hi
you said you "pasted it in the panal".
did you paste it into a standard module or a sheet module? the code that
Jacob supplied is sheet code. right click the sheet tab that you want the
code to run on and from the popup, click view code. paste it there.

Regards
FSt1

"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs



  #6   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

Yes, it works in the new workbook. I am assuming that it has something to do
with the drop down list in my original workbook. Suggestion?

"Jacob Skaria" wrote:

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #7   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

Yes, that is what I did.

"FSt1" wrote:

hi
you said you "pasted it in the panal".
did you paste it into a standard module or a sheet module? the code that
Jacob supplied is sheet code. right click the sheet tab that you want the
code to run on and from the popup, click view code. paste it there.

Regards
FSt1

"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing Row Color

The entries in the list must be having spaces like 'Apple '. To handle this
replace the below line in the code with

<<Select Case Ucase(Target.Text)

Select Case Ucase(Trim(Target.Text))

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Yes, it works in the new workbook. I am assuming that it has something to do
with the drop down list in my original workbook. Suggestion?

"Jacob Skaria" wrote:

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #9   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

Nope, that didn't work either.

"Jacob Skaria" wrote:

The entries in the list must be having spaces like 'Apple '. To handle this
replace the below line in the code with

<<Select Case Ucase(Target.Text)

Select Case Ucase(Trim(Target.Text))

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Yes, it works in the new workbook. I am assuming that it has something to do
with the drop down list in my original workbook. Suggestion?

"Jacob Skaria" wrote:

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing Row Color

It is somthing to do with the workbook. Do you have any conditional
formatting rules? Once you are able to identify; let us know

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Nope, that didn't work either.

"Jacob Skaria" wrote:

The entries in the list must be having spaces like 'Apple '. To handle this
replace the below line in the code with

<<Select Case Ucase(Target.Text)

Select Case Ucase(Trim(Target.Text))

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Yes, it works in the new workbook. I am assuming that it has something to do
with the drop down list in my original workbook. Suggestion?

"Jacob Skaria" wrote:

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Changing Row Color

Let me know your email ID if you would wish me to look into your file

"Jacob Skaria" wrote:

It is somthing to do with the workbook. Do you have any conditional
formatting rules? Once you are able to identify; let us know

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Nope, that didn't work either.

"Jacob Skaria" wrote:

The entries in the list must be having spaces like 'Apple '. To handle this
replace the below line in the code with

<<Select Case Ucase(Target.Text)

Select Case Ucase(Trim(Target.Text))

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Yes, it works in the new workbook. I am assuming that it has something to do
with the drop down list in my original workbook. Suggestion?

"Jacob Skaria" wrote:

--Set the Security level to low/medium in (Tools|Macro|Security).
--Try opening a new workbook. Right click 'Sheet1' tabView code and paste
the code to the code module
--Get back to workbook and type Apple in Col G (any row)


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Ucase(Target.Text)
Case "APPLE"
intCIndex = 3
Case "GRAPE"
intCIndex = 4
Case "CORN"
intCIndex = 5
Case "ORANGE"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub



If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

Thank you for responding so quickly. I did as you suggested, but it didn't
work for me. Can you help more? Do I have to do something to activate it?
I copied and pasted it in the panel and then selected File/Close and Return
to Excel. And, there aren't any colors being displayed. What am I missing?
Please......

"Jacob Skaria" wrote:

Right click the sheet tab View code and paste the below code in the code
panel...


Private Sub Worksheet_Change(ByVal Target As Range)
Dim intCIndex As Integer
If Not Application.Intersect(Target, Range("G:G")) Is Nothing Then
Select Case Target.Text
Case "Apple"
intCIndex = 3
Case "Grape"
intCIndex = 4
Case "Corn"
intCIndex = 5
Case "Orange"
intCIndex = 6
End Select
If intCIndex < 0 Then
Rows(Target.Row).Interior.ColorIndex = intCIndex
Else
Rows(Target.Row).Interior.ColorIndex = 0
End If
End If
End Sub

Refer color index for more colors
1 - Black
2 - White
3 - Red
4 - Green
5 - Blue
6 - Yellow
7 - Magenta
8 - Cyan

If this post helps click Yes
---------------
Jacob Skaria


"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 41
Default Changing Row Color

Hi Gs,

u can also try the following technique

select the range u want to format
click on format - conditional format - select "formula is" and
in the next field type (column constant & row)="apple"
format as per your choice

u r at home.

click yes below, if it helps

"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Changing Row Color

And how would that overcome the 3 condition limit imposed by Excel 2003 when
OP has six conditions.


Gord Dibben MS Excel MVP


On Wed, 2 Sep 2009 10:34:01 -0700, YESHWANT
wrote:

Hi Gs,

u can also try the following technique

select the range u want to format
click on format - conditional format - select "formula is" and
in the next field type (column constant & row)="apple"
format as per your choice

u r at home.

click yes below, if it helps

"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs


  #14   Report Post  
Posted to microsoft.public.excel.misc
GS GS is offline
external usenet poster
 
Posts: 364
Default Changing Row Color

I tried this again this evening, and it is working! Not sure what I was
doing wrong last night. Anyway, thank you, Jacob, for the coding. I
appreciate it very much!

"Gs" wrote:

I would sure appreciate some assistance in row shading / colors.

I am using Excel 2003. I have data in columns A through N, with multiple
rows. Column G has a list box / drop down box, that you make a selection from
the list. There are 6 choices in the list. I am trying to make the row color
change based on what is selected in the list in column G.

For example, when apple is selected from the list, that specific row turns
red. The next row, grape is selected and the row turns green, plum = purple,
corn = yellow, etc.

Conditional formatting allows for 3 conditions, I need 6.

Please and thank you, in advance, for any and all assistance / help /
suggesions.

Gs

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
Font color changing by itself EJamison Excel Discussion (Misc queries) 2 September 18th 08 05:34 PM
Changing color of a row David G[_2_] Excel Discussion (Misc queries) 3 July 20th 07 09:12 PM
color changing of cells changetires Excel Discussion (Misc queries) 7 June 15th 06 07:43 PM
changing the color of the buttons Mr. V Excel Discussion (Misc queries) 4 April 5th 05 02:57 PM
Changing color in color palette Dave Peterson Setting up and Configuration of Excel 0 December 12th 04 02:39 PM


All times are GMT +1. The time now is 03:06 AM.

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"