Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Excel 2003
I have a table of data, and I would like to have a section of it highlighted with a different background color when the user selects the first cell in the row (selecting this cell also drives a couple of other functions as well using the Worksheet_SelectionChange function). The table range is from A7:D14. When A7 is selected, I'd like to have A7:D7 background change to yellow. When a different cell is selected, I need A7:D14 to revert back to their original format (gray background) and have the new selection change to the yellow background. Any thoughts will be greatly appreciated! |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Put this in worksheet code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim block As Range Dim point As Range Set block = Range(Cells(7, 1), Cells(14, 4)) Set point = Cells(7, 1) Cells.Interior.ColorIndex = xlNone If Not Intersect(Target, point) Is Nothing Then block.Interior.ColorIndex = 6 Else Target.Interior.ColorIndex = 6 End If End Sub If A7 is selected, the block will be yellow. If any other cell is selected, then that cell is made yellow. -- Gary's Student "Bob Wall" wrote: Excel 2003 I have a table of data, and I would like to have a section of it highlighted with a different background color when the user selects the first cell in the row (selecting this cell also drives a couple of other functions as well using the Worksheet_SelectionChange function). The table range is from A7:D14. When A7 is selected, I'd like to have A7:D7 background change to yellow. When a different cell is selected, I need A7:D14 to revert back to their original format (gray background) and have the new selection change to the yellow background. Any thoughts will be greatly appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
insert date | Excel Worksheet Functions | |||
What is the macro to change background based on numeric cell value | Excel Worksheet Functions | |||
change cell background color when another cell's value = 40 | Excel Discussion (Misc queries) | |||
change cell shading whenever contents different from previous cell | Excel Discussion (Misc queries) | |||
background color of my cell does not change | Excel Discussion (Misc queries) |