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

In Excel 2007, on WinXP SP3,

I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?

Thanks in advance,

magmike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Change Format of Active Cell

On Jul 12, 8:33*pm, magmike wrote:
In Excel 2007, on WinXP SP3,

I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?

Thanks in advance,

magmike


Right click sheet tabview codeinsert this. Now,when you select a
cell it will hilite it. Does NOT change other formatting.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.FormatConditions.Delete
'With Target.EntireRow
'With Cells(Target.Row, 1).Resize(, 2)
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 6 '35
End With
End Sub
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Change Format of Active Cell

On Jul 14, 8:31*am, Don Guillett wrote:
On Jul 12, 8:33*pm, magmike wrote:

In Excel 2007, on WinXP SP3,


I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?


Thanks in advance,


magmike


Right click sheet tabview codeinsert this. Now,when you select a
cell it will hilite it. Does NOT change other formatting.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * 'With Target.EntireRow
* * 'With Cells(Target.Row, 1).Resize(, 2)
* * With Target
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub


Supercool, and easy!
How would you modify this to change the selections text color if it is
white, to black (but only for the selection period)?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Change Format of Active Cell

On Jul 14, 9:16*pm, magmike wrote:
On Jul 14, 8:31*am, Don Guillett wrote:





On Jul 12, 8:33*pm, magmike wrote:


In Excel 2007, on WinXP SP3,


I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?


Thanks in advance,


magmike


Right click sheet tabview codeinsert this. Now,when you select a
cell it will hilite it. Does NOT change other formatting.


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * 'With Target.EntireRow
* * 'With Cells(Target.Row, 1).Resize(, 2)
* * With Target
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub


Supercool, and easy!
How would you modify this to change the selections text color if it is
white, to black (but only for the selection period)?- Hide quoted text -

- Show quoted text -


I am having problems with my Conditional formatting. I have quite a
few rules that change an entire row's fill color and sometimes text
formatting based on the text in a certain column. When I use this code
in a sheet where this conditional formatting is present, when I make
my first selection, all of the conditional formatting changes
instantly disappear.

Any ideas?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

magmike wrote :
On Jul 14, 9:16*pm, magmike wrote:
On Jul 14, 8:31*am, Don Guillett wrote:





On Jul 12, 8:33*pm, magmike wrote:
In Excel 2007, on WinXP SP3,


I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?
Thanks in advance,


magmike


Right click sheet tabview codeinsert this. Now,when you select a
cell it will hilite it. Does NOT change other formatting.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
* * Cells.FormatConditions.Delete
* * 'With Target.EntireRow
* * 'With Cells(Target.Row, 1).Resize(, 2)
* * With Target
* * * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * * .FormatConditions(1).Interior.ColorIndex = 6 * * *'35
* * End With
End Sub


Supercool, and easy!
How would you modify this to change the selections text color if it is
white, to black (but only for the selection period)?- Hide quoted text -

- Show quoted text -


I am having problems with my Conditional formatting. I have quite a
few rules that change an entire row's fill color and sometimes text
formatting based on the text in a certain column. When I use this code
in a sheet where this conditional formatting is present, when I make
my first selection, all of the conditional formatting changes
instantly disappear.

Any ideas?


The code in the Worksheet_SelectionChange event runs every time you
'select' other cells. Perhaps you want to use the Worksheet_Change
event so your code only runs when cells you specify are edited/changed.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Change Format of Active Cell

This may interest you as a permanent fix for Excel 2007 and not
require any VBA or add-ins.

You can add or modify a key in the Registry if you are comforatble
hacking in the Regsitry.

Best to create a Restore Point before attempting any changes.

StartRun regedit.exe

HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\E xcel\Options

On right-side pane right-click on "Options6" and modifydecimal number
from 32 to 16.

If you don't have an Options6 you must create it by adding a new DWORD
value

EditNewDWORD

Rename to Options6 and set decimal value to 16

Selected cell(s) will be Black


Gord Dibben MS Excel MVP




On Tue, 12 Jul 2011 18:33:44 -0700 (PDT), magmike
wrote:

In Excel 2007, on WinXP SP3,

I would like to be able to change the format of the currently active
cell to make it more easily visible at a quick glance. Currently, the
active cell is just outlined in a thick black line. Is there a way to
change conditional formatting to change the fill color and/or the
outline color of the currently selective/active cell?

Thanks in advance,

magmike

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

Gord, your suggestion doesn't address the active cell, only those
selected along with it (if any).

Not sure why the active cell indicator doesn't work well enough for
magmike, but maybe '_SelectionChange' is the right event to use with
appropriate code. Problem is how to manage non-active cells once
active, and so maybe a global variable to hold its address, which gets
used to clear formatting BEFORE the current active cell's address gets
put into it for next time.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

Example code...

In the module behind the sheet... (right-click sheet tab and choose
'View Code' from the popup menu)

Option Explicit

Dim msActiveAddr As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If msActiveAddr < "" Then Range(msActiveAddr).ClearFormats
Target.Interior.Color = vbRed: msActiveAddr = Target.Address
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Change Format of Active Cell

Thanks Garry

I uninstalled 2007 a while back so had no way to test.

I originally posted that "fix" a couple years ago when someone wanted
a better visual on a selection of multiple cells.

Forgot about a single selection.

I like this from Mike H. which restores existing formatting of any
type.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'cell highlighter
'Mike H.........does not destroy existing formats
Cells.FormatConditions.Delete
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
.Interior.ColorIndex = 6
End With
End With
End Sub


Gord

On Fri, 15 Jul 2011 18:24:18 -0400, GS wrote:

Gord, your suggestion doesn't address the active cell, only those
selected along with it (if any).

Not sure why the active cell indicator doesn't work well enough for
magmike, but maybe '_SelectionChange' is the right event to use with
appropriate code. Problem is how to manage non-active cells once
active, and so maybe a global variable to hold its address, which gets
used to clear formatting BEFORE the current active cell's address gets
put into it for next time.

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Change Format of Active Cell

This code wipes any existing formatting from cells.

See code in my reply to your post to me.


Gord

On Fri, 15 Jul 2011 18:32:25 -0400, GS wrote:

Example code...

In the module behind the sheet... (right-click sheet tab and choose
'View Code' from the popup menu)

Option Explicit

Dim msActiveAddr As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If msActiveAddr < "" Then Range(msActiveAddr).ClearFormats
Target.Interior.Color = vbRed: msActiveAddr = Target.Address
End Sub



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

Gord explained :
Thanks Garry

I uninstalled 2007 a while back so had no way to test.

I originally posted that "fix" a couple years ago when someone wanted
a better visual on a selection of multiple cells.

Forgot about a single selection.

I like this from Mike H. which restores existing formatting of any
type.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'cell highlighter
'Mike H.........does not destroy existing formats
Cells.FormatConditions.Delete
With Target
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
.Interior.ColorIndex = 6
End With
End With
End Sub


Hmm..! I'd have to play around with this some to see how it might work
with magmike's scenario. Large thanks for posting back with this...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

on 7/15/2011, Gord supposed :
This code wipes any existing formatting from cells.

See code in my reply to your post to me.


Yeah, Mike H's code is definitely the way to go here. I really
appreciate you sharing that, Gord. Thanks again!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Change Format of Active Cell

On Jul 15, 5:57*pm, Gord wrote:
Thanks Garry

I uninstalled 2007 a while back so had no way to test.

I originally posted that "fix" a couple years ago when someone wanted
a better visual on a selection of multiple cells.

Forgot about a single selection.

I like this from Mike H. which restores existing formatting of any
type.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'cell highlighter
'Mike H.........does not destroy existing formats
Cells.FormatConditions.Delete
With Target
* * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * With .FormatConditions(1)
* * * * .Interior.ColorIndex = 6
* * End With
End With
End Sub

Gord



On Fri, 15 Jul 2011 18:24:18 -0400, GS wrote:
Gord, your suggestion doesn't address the active cell, only those
selected along with it (if any).


Not sure why the active cell indicator doesn't work well enough for
magmike, but maybe '_SelectionChange' is the right event to use with
appropriate code. Problem is how to manage non-active cells once
active, and so maybe a global variable to hold its address, which gets
used to clear formatting BEFORE the current active cell's address gets
put into it for next time.- Hide quoted text -


- Show quoted text -


Actually, this destroyed the Conditional formatting of EVERY cell once
I made my first selection! Thanks for trying though ;)
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

magmike formulated the question :
On Jul 15, 5:57*pm, Gord wrote:
Thanks Garry

I uninstalled 2007 a while back so had no way to test.

I originally posted that "fix" a couple years ago when someone wanted
a better visual on a selection of multiple cells.

Forgot about a single selection.

I like this from Mike H. which restores existing formatting of any
type.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'cell highlighter
'Mike H.........does not destroy existing formats
Cells.FormatConditions.Delete
With Target
* * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * With .FormatConditions(1)
* * * * .Interior.ColorIndex = 6
* * End With
End With
End Sub

Gord



On Fri, 15 Jul 2011 18:24:18 -0400, GS wrote:
Gord, your suggestion doesn't address the active cell, only those
selected along with it (if any).


Not sure why the active cell indicator doesn't work well enough for
magmike, but maybe '_SelectionChange' is the right event to use with
appropriate code. Problem is how to manage non-active cells once
active, and so maybe a global variable to hold its address, which gets
used to clear formatting BEFORE the current active cell's address gets
put into it for next time.- Hide quoted text -


- Show quoted text -


Actually, this destroyed the Conditional formatting of EVERY cell once
I made my first selection! Thanks for trying though ;)


Not sure why this is happening for you. My existing cell formats remain
intact, and so the code works fine 'as is'!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

GS explained on 7/19/2011 :
magmike formulated the question :
On Jul 15, 5:57*pm, Gord wrote:
Thanks Garry

I uninstalled 2007 a while back so had no way to test.

I originally posted that "fix" a couple years ago when someone wanted
a better visual on a selection of multiple cells.

Forgot about a single selection.

I like this from Mike H. which restores existing formatting of any
type.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'cell highlighter
'Mike H.........does not destroy existing formats
Cells.FormatConditions.Delete
With Target
* * .FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
* * With .FormatConditions(1)
* * * * .Interior.ColorIndex = 6
* * End With
End With
End Sub

Gord



On Fri, 15 Jul 2011 18:24:18 -0400, GS wrote:
Gord, your suggestion doesn't address the active cell, only those
selected along with it (if any).

Not sure why the active cell indicator doesn't work well enough for
magmike, but maybe '_SelectionChange' is the right event to use with
appropriate code. Problem is how to manage non-active cells once
active, and so maybe a global variable to hold its address, which gets
used to clear formatting BEFORE the current active cell's address gets
put into it for next time.- Hide quoted text -

- Show quoted text -


Actually, this destroyed the Conditional formatting of EVERY cell once
I made my first selection! Thanks for trying though ;)


Not sure why this is happening for you. My existing cell formats remain
intact, and so the code works fine 'as is'!


Just to clarify, I did not have any CF. After putting CF in place I see
you're correct! Bummer.., this WAS looking good up to now! Ugh!!!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc




  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

Try...

Option Explicit

Dim msActiveAddr As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range(msActiveAddr).Interior
If msActiveAddr < "" Then .ColorIndex = xlColorIndexNone
End With
With Target
msActiveAddr = .Address
.Interior.ColorIndex = 6
End With
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Change Format of Active Cell

Revised as follows due to no value stored in 'msActiveAddr' on first
execution.

Option Explicit

Dim msActiveAddr As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
If msActiveAddr < "" Then _
Range(msActiveAddr).Interior.ColorIndex = xlColorIndexNone
With Target
msActiveAddr = .Address: .Interior.ColorIndex = 6
End With
Application.ScreenUpdating = True
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


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
Is there a way to change the active cell by a text box? [email protected] Excel Discussion (Misc queries) 1 March 30th 07 03:15 PM
Active Cell To Change Formula PaulW Excel Discussion (Misc queries) 7 September 21st 06 04:03 PM
Format / Highlight the Active Cell [email protected] Excel Programming 1 May 28th 06 03:26 AM
Change Formatting In 'Active' Cell JB2010 Excel Discussion (Misc queries) 4 February 2nd 06 05:58 PM
Change color on active cell Helen Excel Programming 1 November 16th 05 04:07 AM


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