VBA highlight

christian2016

Board Regular
Joined
Oct 6, 2016
Messages
123
Hi Guys,

I have tried a few macros to highlight the active cell.

Issue i have is that any conditional formatting or previous coloured cells will disappear once I highlight that cell and then click on another cell.

If anyone can help on how to write a VBA code to highlight the active cell with out removing any existing conditional formatting or previous coloured cells that would be great.

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
VBA code to highlight the active cell with out removing any existing conditional formatting

I don't believe there is a simple way to do this
You will have to write a macro to reapply the CF when the cell is not active !!
 
Upvote 0
christian2016,

If you're just trying to make the active cell more visible, you might consider this workaround...

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count = 1 Then
    Range(Cells(Target.Row, Target.Column + 1), Cells(Target.Row + 1, Target.Column)).Select
    Target.Activate
End If
End Sub

Selecting a cell will now actually select 4 cells, with the active cell always in the upper left. No change in color, but easier to see than just a single cell.

Cheers,

tonyyy
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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