Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
color of active cell
I have a variant of an earlier post.
I want to change the color of the active cell to yellow, but when the active cell changes to another cell, I want the cell to revert back to the original color it was prior to becoming the active cell. - (hope that makes sense!) Many thanks in advance for making my life easier. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
color of active cell
Robb I'm not a fan of such (useless) code, but.. If you think it serves a purpose then put following in the sheet's code module Option Explicit Dim rngPrev As Range Dim idxPrev As Long Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub Application.ScreenUpdating = False If Not rngPrev Is Nothing Then rngPrev.Interior.ColorIndex = idxPrev Set rngPrev = Target idxPrev = rngPrev.Interior.ColorIndex rngPrev.Interior.ColorIndex = 6 Application.ScreenUpdating = True End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Robb27 wrote : I have a variant of an earlier post. I want to change the color of the active cell to yellow, but when the active cell changes to another cell, I want the cell to revert back to the original color it was prior to becoming the active cell. - (hope that makes sense!) Many thanks in advance for making my life easier. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
color of active cell
Thanks keepITcool. It is just what I needed to help my very non-computer
literate employes very much. Robb "keepITcool" wrote: Robb I'm not a fan of such (useless) code, but.. If you think it serves a purpose then put following in the sheet's code module Option Explicit Dim rngPrev As Range Dim idxPrev As Long Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Count 1 Then Exit Sub Application.ScreenUpdating = False If Not rngPrev Is Nothing Then rngPrev.Interior.ColorIndex = idxPrev Set rngPrev = Target idxPrev = rngPrev.Interior.ColorIndex rngPrev.Interior.ColorIndex = 6 Application.ScreenUpdating = True End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Robb27 wrote : I have a variant of an earlier post. I want to change the color of the active cell to yellow, but when the active cell changes to another cell, I want the cell to revert back to the original color it was prior to becoming the active cell. - (hope that makes sense!) Many thanks in advance for making my life easier. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
color of active cell
You do know that XL highlights the selected cell by putting a border
around it *and* changing the color of the associated row & column numbers. -- Regards, Tushar Mehta www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , Robb27 @discussions.microsoft.com says... I have a variant of an earlier post. I want to change the color of the active cell to yellow, but when the active cell changes to another cell, I want the cell to revert back to the original color it was prior to becoming the active cell. - (hope that makes sense!) Many thanks in advance for making my life easier. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Active Cell Color | Excel Worksheet Functions | |||
hOW TO GET COLOR FOR ACTIVE CELL | Excel Discussion (Misc queries) | |||
Color active cell | Excel Discussion (Misc queries) | |||
Active Cell Color | Excel Discussion (Misc queries) | |||
Only want color to show when cell is active | Excel Worksheet Functions |