#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Active cell

How can I high light a group of cells from different active cells? For
example, when cell A1 is the active cell, I would like to high light cells
D1:F3, A2 highlight cells D5:F7 etc.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Active cell

By "highlight" do you mean "select" or "change color"?

If change color, do you want D1:F3 uncolored when D5:F7 are colored?

What is the extent of "etc."?


Gord Dibben MS Excel MVP

On Mon, 16 Apr 2007 09:26:05 -0700, village_idiot
wrote:

How can I high light a group of cells from different active cells? For
example, when cell A1 is the active cell, I would like to high light cells
D1:F3, A2 highlight cells D5:F7 etc.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Active cell

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
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Active cell

That's for the info, I'll try it after work. In answer to Gord Dibben, I
have to do this 81 times. I made a spread sheet to help play Sudoku.

"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

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

I sould say Thanks not That's

"village_idiot" wrote:

That's for the info, I'll try it after work. In answer to Gord Dibben, I
have to do this 81 times. I made a spread sheet to help play Sudoku.

"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



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

One more question, I take it that 6 is the color, is there a list of the
different colors and their numbers?

"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

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Active cell

Yes 6 is a nice bright yellow.


In:

http://www.mvps.org/dmcritchie/excel/colors.htm

see the section:
ColorIndex -- 56 Excel Colors [#colors56/#colorindex]


for a complete list

--
Gary''s Student - gsnu200715


"village_idiot" wrote:

One more question, I take it that 6 is the color, is there a list of the
different colors and their numbers?

"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

  #8   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

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Active cell

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

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

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

End Sub

This version does not clear all the formats, just the ones the logic is
controlling
--
Gary''s Student - gsnu200715
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Active cell

Maybe, instead of re-inventing wheel, you could download Andy Pope's sudoku
puzzle generator and solver.

http://www.andypope.info/fun/sudoku.htm




On Mon, 16 Apr 2007 10:12:03 -0700, village_idiot
wrote:

That's for the info, I'll try it after work. In answer to Gord Dibben, I
have to do this 81 times. I made a spread sheet to help play Sudoku.

"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




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

Again, thanks and a question. Can I name the range of cells? Like I said
I'm going to have 81 cells to do this with, with about 629 cells for each of
the 81 to clear of color. I'm sorry to be such a pain, but I'm self taught
and so far I haven't taught myself anything about this kind of stuff, but I'm
learning from you.

"Gary''s Student" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

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

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

End Sub

This version does not clear all the formats, just the ones the logic is
controlling
--
Gary''s Student - gsnu200715

  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Active cell

You are not a pain. This is fun. Yes you can use Named Ranges ( which we
can define in either the worksheet or the macro). We can gives names to each
of the small blocks of cells and make a super range by combining them. Or if
all the small blocks are in cols D-F, then we can clear the color out of just
these three columns and paint the color in the selected small block.


There are lots of options.
--
Gary''s Student - gsnu200715
  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Active cell

I may not be a pain, but like I said I'm self-taught and my teacher is an
idiot. If it would help you, I can send a copy of my Sudoku worksheet and
you can see what I'm trying to do. I'm a newbie at this site, so I don't
know if it's allowed to put our e-mail address in, but if it's ok I'll get in
touch with you and give you a copy, as long you don't laugh to hard at the
way I did things.

"Gary''s Student" wrote:

You are not a pain. This is fun. Yes you can use Named Ranges ( which we
can define in either the worksheet or the macro). We can gives names to each
of the small blocks of cells and make a super range by combining them. Or if
all the small blocks are in cols D-F, then we can clear the color out of just
these three columns and paint the color in the selected small block.


There are lots of options.
--
Gary''s Student - gsnu200715

  #16   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Active cell

Hi v.i

Conditional Formatting is not sensitive to the active cell, but if you put a
value in a cell, Condtional Formatting can respond to it. Use Formula Is


=$E$9<""


or some other form.
--
Gary''s Student - gsnu200716


"village_idiot" wrote:

I've been working with your info and came to the conclusion that it will be a
very big answer to my question (81 bunchs of 11 or 12 statements each). So,
what would the formula be to use conditional formating to do the trick? In
other words, how do I tell the conditional format to activate only when a
certain cell is active?

"Gary''s Student" wrote:

adjust lukewarm to hot and send it to :


--
Gary''s Student - gsnu200715


"village_idiot" wrote:

I may not be a pain, but like I said I'm self-taught and my teacher is an
idiot. If it would help you, I can send a copy of my Sudoku worksheet and
you can see what I'm trying to do. I'm a newbie at this site, so I don't
know if it's allowed to put our e-mail address in, but if it's ok I'll get in
touch with you and give you a copy, as long you don't laugh to hard at the
way I did things.

"Gary''s Student" wrote:

You are not a pain. This is fun. Yes you can use Named Ranges ( which we
can define in either the worksheet or the macro). We can gives names to each
of the small blocks of cells and make a super range by combining them. Or if
all the small blocks are in cols D-F, then we can clear the color out of just
these three columns and paint the color in the selected small block.


There are lots of options.
--
Gary''s Student - gsnu200715

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

Thanks Gary"s most excellant student

I wanted to use the conditional formatting before entering anything in the
cell. So, I guess it's back to the otherway.

"Gary''s Student" wrote:

Hi v.i

Conditional Formatting is not sensitive to the active cell, but if you put a
value in a cell, Condtional Formatting can respond to it. Use Formula Is


=$E$9<""


or some other form.
--
Gary''s Student - gsnu200716


"village_idiot" wrote:

I've been working with your info and came to the conclusion that it will be a
very big answer to my question (81 bunchs of 11 or 12 statements each). So,
what would the formula be to use conditional formating to do the trick? In
other words, how do I tell the conditional format to activate only when a
certain cell is active?

"Gary''s Student" wrote:

adjust lukewarm to hot and send it to :


--
Gary''s Student - gsnu200715


"village_idiot" wrote:

I may not be a pain, but like I said I'm self-taught and my teacher is an
idiot. If it would help you, I can send a copy of my Sudoku worksheet and
you can see what I'm trying to do. I'm a newbie at this site, so I don't
know if it's allowed to put our e-mail address in, but if it's ok I'll get in
touch with you and give you a copy, as long you don't laugh to hard at the
way I did things.

"Gary''s Student" wrote:

You are not a pain. This is fun. Yes you can use Named Ranges ( which we
can define in either the worksheet or the macro). We can gives names to each
of the small blocks of cells and make a super range by combining them. Or if
all the small blocks are in cols D-F, then we can clear the color out of just
these three columns and paint the color in the selected small block.


There are lots of options.
--
Gary''s Student - gsnu200715

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

With a lot of help from Gary"s_Student I got the job done! I still think
that there should be a way to use a formula in a Conditional Format, but I
couldn't find a way to get it to see what cell is active.

"village_idiot" wrote:

I've been working with your info and came to the conclusion that it will be a
very big answer to my question (81 bunchs of 11 or 12 statements each). So,
what would the formula be to use conditional formating to do the trick? In
other words, how do I tell the conditional format to activate only when a
certain cell is active?

"Gary''s Student" wrote:

adjust lukewarm to hot and send it to :


--
Gary''s Student - gsnu200715


"village_idiot" wrote:

I may not be a pain, but like I said I'm self-taught and my teacher is an
idiot. If it would help you, I can send a copy of my Sudoku worksheet and
you can see what I'm trying to do. I'm a newbie at this site, so I don't
know if it's allowed to put our e-mail address in, but if it's ok I'll get in
touch with you and give you a copy, as long you don't laugh to hard at the
way I did things.

"Gary''s Student" wrote:

You are not a pain. This is fun. Yes you can use Named Ranges ( which we
can define in either the worksheet or the macro). We can gives names to each
of the small blocks of cells and make a super range by combining them. Or if
all the small blocks are in cols D-F, then we can clear the color out of just
these three columns and paint the color in the selected small block.


There are lots of options.
--
Gary''s Student - gsnu200715

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
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 09:29 PM.

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"