Capture event when exit Column G
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 -- Regards Frank Kabel Frankfurt, Germany zSplash wrote: 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 |
Thanks, Frank.
st. "Frank Kabel" wrote in message ... 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 -- Regards Frank Kabel Frankfurt, Germany zSplash wrote: 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 |
All times are GMT +1. The time now is 04:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com