How to highlight Active Cell in Excel using Conditional Formatting.

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,840
Office Version
  1. 2019
Platform
  1. Windows
Hey Excel Gurus,

I would like to know the formula for highlighting the active cell of my worksheet using Excel's built in Conditional Formatting rules.

Will appreciate and thank you.
 
Last edited:

Some videos you may like

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,598
I don't think that conditional formatting will work with the active cell. A macro can do what you want if you're interested.
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,840
Office Version
  1. 2019
Platform
  1. Windows
I don't think that conditional formatting will work with the active cell. A macro can do what you want if you're interested.

I am afraid that the vba code would not work without resetting the undo function . example (Ctrl+z).
 
Last edited:

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,840
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

But you do know what Undo (Ctrl+z) is? right?
 

mumps

Well-known Member
Joined
Apr 11, 2012
Messages
9,598
I do know and also that any action performed by a macro cannot be undone. However, to do what you requested requires a macro so you have to decide which way to go.
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,840
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

I do know and also that any action performed by a macro cannot be undone. However, to do what you requested requires a macro so you have to decide which way to go.


Well I would have to call it quits then ..
hence no code for my requirment.
 

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
1,840
Office Version
  1. 2019
Platform
  1. Windows
actually some actions can be undone after using the vba. but for what I requested meaning to highlight and edit the formatting of the cell or editing the content of the cell itself are irreversible with Undo.
 

NoSparks

Well-known Member
Joined
Mar 15, 2013
Messages
997
Office Version
  1. 2010
Platform
  1. Windows
Perhaps you could adapt Peter_SSs suggestion from here
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,882
Office Version
  1. 2013
Platform
  1. Windows
You can try this:
But it will remove all cells interior color except for the active cell.

The active cell will have a interior color of Green.

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Modified  3/9/2019  6:47:30 PM  EST
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
Selection.Interior.ColorIndex = 4
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,109,541
Messages
5,529,437
Members
409,877
Latest member
DDhol
Top