Highlight the Active Row and Column

Highlight the Active Row and Column

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range,

Cancel As Boolean)

Dim strRange As String

strRange = Target.Cells.Address & "," Target.Cells.EntireColumn.Address & "," & _

Target.Cells.EntireRow.Address

Range(strRange).Select

End Sub

Here are the quick steps to apply this code.


 * 1) Open VBE (ALT + F11).
 * 2) Go to Project Explorer (Ctrl + R, If hidden).
 * 3) Select your workbook & double click on the name of a particular worksheet in which you want to activate the macro.
 * 4) Paste the code into it and select the “BeforeDoubleClick” from event drop down menu.
 * 5) Close VBE and you are done.

Remember that, by applying this macro you will not able to edit the cell by double click.

https://excelchamps.com/blog/useful-macro-codes-for-vba-newcomers/