A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

colour active cell



 
 
Thread Tools Display Modes
  #1  
Old September 19th, 2009, 02:06 AM posted to microsoft.public.access.gettingstarted
Ron
external usenet poster
 
Posts: 690
Default colour active cell

The cell is GREEN while ACTIVE and turns WHITE after it is no lnger ACTIVE.
If my cell is already colour coded, it looses its colour when no longer
ACTIVE. Can this code be changed so that a cell returns to its ORIGINAL
formmating when no longer ACTIVE?
Code is:


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)
Static OldCell As Range

If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If

Target.Interior.ColorIndex = 4

Set OldCell = Target


End Sub
  #2  
Old September 19th, 2009, 02:47 AM posted to microsoft.public.access.gettingstarted
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default colour active cell

Your question may be better answered in an Excel newsgroup appropriate to
your problem. This newsgroup is dedicated to the Microsoft Access database
product. The Microsoft website may have misdirected you.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"Ron" wrote in message
...
The cell is GREEN while ACTIVE and turns WHITE after it is no lnger
ACTIVE.
If my cell is already colour coded, it looses its colour when no longer
ACTIVE. Can this code be changed so that a cell returns to its ORIGINAL
formmating when no longer ACTIVE?
Code is:


Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target
As Excel.Range)
Static OldCell As Range

If Not OldCell Is Nothing Then
OldCell.Interior.ColorIndex = xlColorIndexNone
End If

Target.Interior.ColorIndex = 4

Set OldCell = Target


End Sub



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:30 PM.


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