Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Please Help!
I'm using the following in VBA: Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Target.Interior.ColorIndex = icolor End If End Sub It change the color in that cell but I want it to color the row from coulums A to N? Can somebody show me how to do that? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Simply add a loop using the targets row property:
For myloop = 1 To 14 ActiveSheet.Cells(Target.Row, myloop).Interior.ColorIndex = icolor Next "J-D" wrote: Please Help! I'm using the following in VBA: Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Target.Interior.ColorIndex = icolor End If End Sub It change the color in that cell but I want it to color the row from coulums A to N? Can somebody show me how to do that? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Stop Target.EntireRow.Interior.ColorIndex = icolor End If End Sub "J-D" wrote in message ... Please Help! I'm using the following in VBA: Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Target.Interior.ColorIndex = icolor End If End Sub It change the color in that cell but I want it to color the row from coulums A to N? Can somebody show me how to do that? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Excellent! Thank you Dom_Ciccone.
"Dom_Ciccone" wrote: Simply add a loop using the targets row property: For myloop = 1 To 14 ActiveSheet.Cells(Target.Row, myloop).Interior.ColorIndex = icolor Next "J-D" wrote: Please Help! I'm using the following in VBA: Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Target.Interior.ColorIndex = icolor End If End Sub It change the color in that cell but I want it to color the row from coulums A to N? Can somebody show me how to do that? |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Oops! "Stop" should not have been left in the code.
"PCLIVE" wrote in message ... Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Stop Target.EntireRow.Interior.ColorIndex = icolor End If End Sub "J-D" wrote in message ... Please Help! I'm using the following in VBA: Private Sub Worksheet_Change(ByVal Target As Range) Dim icolor As Integer If Not Intersect(Target, Range("A6:n2000")) Is Nothing Then Select Case Target Case 15 icolor = 4 Case -15 icolor = 46 Case 100 icolor = 6 Case -100 icolor = 3 Case Else 'Whatever End Select Target.Interior.ColorIndex = icolor End If End Sub It change the color in that cell but I want it to color the row from coulums A to N? Can somebody show me how to do that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Coloring rows of cells | Excel Discussion (Misc queries) | |||
Coloring rows in excel | Excel Worksheet Functions | |||
COLORING IN CELLS | Excel Discussion (Misc queries) | |||
coloring in rows | Excel Discussion (Misc queries) | |||
Coloring certain cells | Excel Worksheet Functions |