Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Active cell

Again thanks for the help, but I'm having problems and the debug program says
that the problem is with the line that reads "Cells.Interior.ColorIndex =
x|none". The worksheet has some cells of different colors already, how do I
change that line to keep the other cells color and only change the ranges of
cells I want changed

"Gary''s Student" wrote:

Use an event macro:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
If Intersect(Target, Range("A1")) Is Nothing Then
Else
Range("D1:F3").Interior.ColorIndex = 6
End If

If Intersect(Target, Range("A2")) Is Nothing Then
Else
Range("D5:F7").Interior.ColorIndex = 6
End If

End Sub


This goes in Worksheet code, not a standard module.
--
Gary''s Student - gsnu200715

 
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
Get Address of Active Cell LarryL Excel Discussion (Misc queries) 3 February 16th 07 10:02 PM
value of the active cell caroline Excel Worksheet Functions 2 June 21st 06 05:34 PM
Active Cell Color jamex Excel Discussion (Misc queries) 1 March 9th 06 07:52 PM
HOW TO COPY 480 ACTIVE E-MAIL ADDRESSES CLM "G" ON AN ACTIVE EXCE. ragman10 Excel Discussion (Misc queries) 1 December 13th 04 11:52 PM
Sum to active cell GregR Excel Discussion (Misc queries) 4 December 10th 04 10:01 PM


All times are GMT +1. The time now is 04:45 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"