How to run a procedure on entering a specific cell?
How to run a procedure on entering a specific cell?
I am trying to pop up a calendar control to enter a date into a specific cell. For example: when the user moves the cursor to "B5", the calendar control should become visible. The user then clicks on a date, which is updated in cell "B5" My problem is I do not know how to detect when the user selects a specific cell in order to run the procedure. Is there a way? |
How to run a procedure on entering a specific cell?
Create:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) in worksheet code. Target tells you which cell(s) have been selected. HTH -- AP a écrit dans le message de oups.com... How to run a procedure on entering a specific cell? I am trying to pop up a calendar control to enter a date into a specific cell. For example: when the user moves the cursor to "B5", the calendar control should become visible. The user then clicks on a date, which is updated in cell "B5" My problem is I do not know how to detect when the user selects a specific cell in order to run the procedure. Is there a way? |
How to run a procedure on entering a specific cell?
Hi, try this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) cell_position = "$B$5" check = ActiveCell.CurrentRegion.Address If cell_position = check Then MsgBox "Your action" ' runs when a the cell is entered End Sub " napĂ*sal (napĂ*sala): How to run a procedure on entering a specific cell? I am trying to pop up a calendar control to enter a date into a specific cell. For example: when the user moves the cursor to "B5", the calendar control should become visible. The user then clicks on a date, which is updated in cell "B5" My problem is I do not know how to detect when the user selects a specific cell in order to run the procedure. Is there a way? |
All times are GMT +1. The time now is 09:53 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com