How to highlight Active Cell in Excel using Conditional Formatting.

omairhe

Well-known Member
Joined
Mar 26, 2009
Messages
2,040
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:

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I don't think that conditional formatting will work with the active cell. A macro can do what you want if you're interested.
 
Upvote 0
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:
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,223,786
Messages
6,174,548
Members
452,572
Latest member
KP53

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top