ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell Activate Event (https://www.excelbanter.com/excel-programming/333219-cell-activate-event.html)

Steph[_3_]

Cell Activate Event
 
Hello. Is there a way to essentially do a cell activate event? WhatI'm
trying to do is have a Sub fire if and when a user clicks on any cell within
column F. So for instance, if the user clicks on F5, then Sub Run_Main
executes. Thanks!



Bob Phillips[_7_]

Cell Activate Event
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column = 6 Then
With Target
'do your stuff
End With
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to essentially do a cell activate event? WhatI'm
trying to do is have a Sub fire if and when a user clicks on any cell

within
column F. So for instance, if the user clicks on F5, then Sub Run_Main
executes. Thanks!





Steph[_3_]

Cell Activate Event
 
Wow, I always thought the worksheet_selectionchange event was triggered when
something was entered in the cell (like a doubleclick, or simply typing
something in the cell and hitting enter), not as soon as it was activated.
Learn something new everyday...Thanks Bob!

"Bob Phillips" wrote in message
...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column = 6 Then
With Target
'do your stuff
End With
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to essentially do a cell activate event? WhatI'm
trying to do is have a Sub fire if and when a user clicks on any cell

within
column F. So for instance, if the user clicks on F5, then Sub Run_Main
executes. Thanks!







Norman Jones

Cell Activate Event
 
Hi Steph,

You might like to look at Chip Pearson's page on Event Procedures at:

http://www.cpearson.com/excel/events.htm

---
Regards,
Norman



"Steph" wrote in message
...
Wow, I always thought the worksheet_selectionchange event was triggered
when something was entered in the cell (like a doubleclick, or simply
typing
something in the cell and hitting enter), not as soon as it was activated.
Learn something new everyday...Thanks Bob!

"Bob Phillips" wrote in message
...
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Column = 6 Then
With Target
'do your stuff
End With
End If
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
HTH

Bob Phillips

"Steph" wrote in message
...
Hello. Is there a way to essentially do a cell activate event? WhatI'm
trying to do is have a Sub fire if and when a user clicks on any cell

within
column F. So for instance, if the user clicks on F5, then Sub Run_Main
executes. Thanks!










All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com