Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Format / Highlight the Active Cell

I have found some good solutions to my problem, but not one that fits
the bill exactly.

I'm looking to format the active cell with a yellow background, but I
need to ensure that the cell's format previous to it being active
remains as it was after the cell is no longer active. All the solutions
I have seen remove the background after the cell is no longer active.

So, if I have a cell with a black background (for instance) and I make
it the active cell the cell will have a yellow background. After I
leave that cell, I need it to return to it's previous state - black
background, not none.

I have tried this code...

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object,
ByVal Target As Excel.Range)
Static OldRange As Range
On Error Resume Next
Target.Interior.ColorIndex = 6 ' yellow - change as needed
OldRange.Interior.ColorIndex = xlColorIndexNone
Set OldRange = Target

End Sub

....and I think the answer may lie here "OldRange.Interior.ColorIndex =
xlColorIndexNone"

Any help would be greatly appreciated. Thank you in advance!

-M

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Format / Highlight the Active Cell

I actually figured it out. I lock the workbook and don't allow users to
select locked cells, but do allow users to format cells.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
Active Cell Highlight Bill_17256 Excel Discussion (Misc queries) 6 April 24th 09 11:00 PM
Conditional Format to Highlight the Active Cell Pawprint Excel Worksheet Functions 1 July 30th 08 09:03 PM
Active cell highlight E Excel Discussion (Misc queries) 21 February 15th 08 09:40 PM
Highlight Active Cell Db1712 Excel Discussion (Misc queries) 1 November 26th 04 01:14 PM


All times are GMT +1. The time now is 06:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"