Capture event when exit Column G

  • Thread starter Thread starter zSplash
  • Start date Start date
Z

zSplash

I want to code something whenever there's a change in Column G/8. Some
users use the Mouse, others use the Tab, others use the Enter key, so it
isn't just a Target.Column=9 deal.

Would someone please start me in the right direction for coding on exit of a
cell in Column G/8?

TIA
 
Hi
I'd use the slection_change event. Put the following code in your worksheet
module:
(Note: column G ist the 7th column)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static old_column As Integer
If Target.Column <> 7 Then
If old_column = 7 Then
MsgBox "you just exited column G"
End If
End If
old_column = Target.Column
End Sub
 
Thanks, Frank.

st.
Frank Kabel said:
Hi
I'd use the slection_change event. Put the following code in your worksheet
module:
(Note: column G ist the 7th column)
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static old_column As Integer
If Target.Column <> 7 Then
If old_column = 7 Then
MsgBox "you just exited column G"
End If
End If
old_column = Target.Column
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top