Forum Discussion

Lorenzo Kim's avatar
Lorenzo Kim
Bronze Contributor
Jun 04, 2018

prevent cursor from going to the headers

I don't want to use sheet protect on the scenario below, as it makes quirky moves...

Whenever the cursor moves to any column headers, make it go to or land on range("A2") always.

the header is in row 1..

HOW DO I WRITE THE CODE IN Private Sub Worksheet_Change(ByVal Target As Range) for this event?

many thanks

 

 

  • I have found an article that solved my query!

     

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

        If Target.Row = 1 Then
            Range("A2").Select
        End If

    End Sub

    HOPE THIS WILL HELP OTHERS

    MANY THANKS

     

  • Lorenzo Kim's avatar
    Lorenzo Kim
    Bronze Contributor

    I have found an article that solved my query!

     

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

        If Target.Row = 1 Then
            Range("A2").Select
        End If

    End Sub

    HOPE THIS WILL HELP OTHERS

    MANY THANKS

     

Resources