Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi there
i got this Macro code, which makes the Active cell change colour, but the problem is that once you move away from that cell it leaves that cell with no colour. I need it to return the colour the cell was before it became active. What would i do to this code: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Static OldCell As Range If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone End If Target.Interior.ColorIndex = 8 Set OldCell = Target End Sub Any help gratefully received cheers jb |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
See
http://www.mcgimpsey.com/excel/highl...iteRetainColor In article , JB2010 wrote: Hi there i got this Macro code, which makes the Active cell change colour, but the problem is that once you move away from that cell it leaves that cell with no colour. I need it to return the colour the cell was before it became active. What would i do to this code: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Static OldCell As Range If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone End If Target.Interior.ColorIndex = 8 Set OldCell = Target End Sub |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
LEGEND!!!!
cheers jb "JE McGimpsey" wrote: See http://www.mcgimpsey.com/excel/highl...iteRetainColor In article , JB2010 wrote: Hi there i got this Macro code, which makes the Active cell change colour, but the problem is that once you move away from that cell it leaves that cell with no colour. I need it to return the colour the cell was before it became active. What would i do to this code: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) Static OldCell As Range If Not OldCell Is Nothing Then OldCell.Interior.ColorIndex = xlColorIndexNone End If Target.Interior.ColorIndex = 8 Set OldCell = Target End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you apply split colour formatting to the same cell? | Excel Discussion (Misc queries) | |||
need to Copy or Move to active cell from specified range | Excel Discussion (Misc queries) | |||
Closing File Error | Excel Discussion (Misc queries) | |||
macro help | Excel Discussion (Misc queries) | |||
cell color index comparison | New Users to Excel |