View Single Post
 
Old 09-15-2019, 06:20 AM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 831
NoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really niceNoSparks is just really nice
Default

Turning on the macro recorder and clicking into cell "C7" then hitting shift + space then stopping the recorder,
the macro Excel/vba produces is only two lines of code
Code:
Sub Macro1()
'
' Macro1 Macro
' record shift + space when clicking into a cell
'

'
    Rows("7:7").Select
    Range("C7").Activate
End Sub
The first line selects the entire row and the second activates the cell.

This can be done automatically using The Worksheet_SelectionChange event.
This event 'triggers' every time a cell is entered and the entered cell is the Target.
Right click the sheet tab, click 'View code' and paste this into the sheet module.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Target.EntireRow.Select
    Target.Activate
End Sub
Reply With Quote