Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default a way to color the CURRENT row or cell when selected


How can deactivate the function Sub Worksheet_SelectionChange?


--
haneira
------------------------------------------------------------------------
haneira's Profile: http://www.excelforum.com/member.php...o&userid=24065
View this thread: http://www.excelforum.com/showthread...hreadid=372145

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default a way to color the CURRENT row or cell when selected

If you want the currently selected range/cell to be colored and the
color cleared from the previously selected range or cell, then you will
need to keep track of that last range selected.

Declare a private variable at the module level, and set its range upon
activation. Then when SelectionChange is called, clear the last range,
color the target range and set the last range variable to the current
target, as follows

Private lastRange As Range ' module level declaration

Private Sub Worksheet_Activate()
Set lastRange = ActiveCell
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
lastRange.Interior.ColorIndex = xlColorIndexNone
Target.Interior.Color = RGB(255, 255, 0) ' yellow
Set lastRange = Target
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default a way to color the CURRENT row or cell when selected


This maybe useful for you ??

http://office.microsoft.com/en-us/as...366231033.aspx

If conditionall formating is a problem ... then here is an
alternative.

http://www.xcelfiles.com/Excel02.html#anchor_67


--
Ivan F Moala


------------------------------------------------------------------------
Ivan F Moala's Profile: http://www.excelforum.com/member.php...fo&userid=1954
View this thread: http://www.excelforum.com/showthread...hreadid=372145

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
Change tab color based on current color of a cell MarkT Excel Discussion (Misc queries) 0 May 22nd 08 05:46 PM
Macro to run relative to current selected cell MahD Excel Discussion (Misc queries) 3 December 11th 06 06:18 AM
Change Cell Color if in current Month Leslie Excel Worksheet Functions 6 June 28th 05 06:17 PM
how can one obtain the current selected cell value Susan Hayes Excel Programming 3 December 14th 04 10:31 AM
Current Cell Color mike47338 Excel Worksheet Functions 5 December 10th 04 06:45 PM


All times are GMT +1. The time now is 01:20 AM.

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

About Us

"It's about Microsoft Excel"