View Single Post
 
Old 11-12-2014, 03:42 AM
whatsup whatsup is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: May 2014
Posts: 137
whatsup will become famous soon enough
Default

Htiek, then you will need a construct like this with a public variable:
Code:
Option Explicit
Private blnJump As Boolean
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If blnJump Then
        Range("G11").Select
        blnJump = False
    End If
    If Not Intersect(Target, Range("K12")) Is Nothing Then
        blnJump = True
    End If
End Sub
The code sets blnJump to True once you enter K12. You can either change K12 or leave it unchanged. Leaving K12 will trigger the event again, and will select G11 setting blnJump to False.
The disadvantage: SelectionChange is triggered all the time with selecting a cell within the sheet (though it won't happen anything unless you select K12). Personally I stay away from such events, but I can't think of another possibility.
Reply With Quote