Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
I have used the following:
Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub But what I really want to do is to color the entire row in one color and the changed cell in another. Any code out there please? TIA Zorro |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
Add the line: Target.EntireRow.Interior.ColorIndex = 3
"Zorro" wrote: I have used the following: Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub But what I really want to do is to color the entire row in one color and the changed cell in another. Any code out there please? TIA Zorro |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
Private Sub Worksheet_Change(ByVal Target As Range)
Target.EntireRow.Interior.ColorIndex = 37 Target.Interior.ColorIndex = 8 End Sub HTH, "Zorro" wrote in message .uk... I have used the following: Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub But what I really want to do is to color the entire row in one color and the changed cell in another. Any code out there please? TIA Zorro |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
I would add a safeguard to ensure that Target is only one row tall.
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Rows.Count = 1 Then Target.EntireRow.Interior.ColorIndex = 37 Target.Interior.ColorIndex = 8 End If End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com (email address is on the web site) "George Nicholson" wrote in message ... Private Sub Worksheet_Change(ByVal Target As Range) Target.EntireRow.Interior.ColorIndex = 37 Target.Interior.ColorIndex = 8 End Sub HTH, "Zorro" wrote in message .uk... I have used the following: Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub But what I really want to do is to color the entire row in one color and the changed cell in another. Any code out there please? TIA Zorro |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
Thanks for that. One problem though. I can only highlight one change per row
using the code below. Is there a way to highlight a number of cells on the same row as they are changed. They may not neccessarily be contiguous. Private Sub Worksheet_Change(ByVal Target As Range) Target.EntireRow.Interior.ColorIndex = 3 Target.Interior.ColorIndex = 8 End Sub Cheers Zorro "bigwheel" wrote in message ... Add the line: Target.EntireRow.Interior.ColorIndex = 3 "Zorro" wrote: I have used the following: Private Sub Worksheet_Change(ByVal Target As Range) Target.Interior.ColorIndex = 8 End Sub But what I really want to do is to color the entire row in one color and the changed cell in another. Any code out there please? TIA Zorro |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Color a cell When Change Is Made
If the coloring is only to help identify the cell during
the time that it is selected see Chip's RowLiner addin http://www.cpearson.com/excel/RowLiner.htm "Chip Pearson" I would add a safeguard to ensure that Target is only one row tall. Private Sub Worksheet_Change(ByVal Target As Range) If Target.Rows.Count = 1 Then Target.EntireRow.Interior.ColorIndex = 37 Target.Interior.ColorIndex = 8 End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using an offset formula for the reference in a relative reference | Excel Worksheet Functions | |||
How to change a tab name with cell reference and formula? | Excel Worksheet Functions | |||
How to change the value of a cell when a condition is satisfied, but not otherwise? | Excel Discussion (Misc queries) | |||
change cell shading whenever contents different from previous cell | Excel Discussion (Misc queries) | |||
conditional cell shading when a change occurs | Excel Discussion (Misc queries) |