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
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,864
Messages
6,121,986
Members
449,058
Latest member
oculus

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