how to highlight the selected cell

akschary

New Member
Joined
Nov 25, 2011
Messages
18
Dear all
How to highlight the selected cell which is very usefull when we search a paticular cell in a large data so please any one tell me how to highlight
 

Some videos you may like

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

L. Howard

Well-known Member
Joined
Oct 16, 2012
Messages
4,514
Assumes the sheet has no other color formatting on it, otherwise that will be deleted on first selection.

Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Cells.Interior.ColorIndex = xlNone
  ActiveCell.Interior.ColorIndex = 6
End Sub

If you have any interest in highlighting the entire row (or even just a predetermined number of cells across a row) that is quite possible.

Also, you could have "Large Block O Data-1" and somewhere else on the sheet have "Large Block O Data-2" and when you click in either Block O Data the row will be highlighted from left edge to right edge of that Block O Data boundaries.

Might be more than you need or want, but FYI.

Regards,
Howard
 

L. Howard

Well-known Member
Joined
Oct 16, 2012
Messages
4,514
Try this in the sheet module.
If you want the column also, uncomment that line.

Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
  Cells.Interior.ColorIndex = xlNone
  ActiveCell.EntireRow.Interior.ColorIndex = 6
  'ActiveCell.EntireColumn.Interior.ColorIndex = 6
End Sub

Regards,
Howard
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,329
Members
414,055
Latest member
mcarduner

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
Top