Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launching a Macro bt Double Clicking
I would like to launch an Excel macro by double clicking on a cell in an
Excel worksheet. I used one of your answers to a similar question and wrote the following code in the "View Code" area of the worksheet. Private Sub Woorksheet_BeforeDoubleClick_(ByVal Target As Range, Cancel As Boolean) If Target.Address = "$E$5" Then Call Find2 End If End Sub If I then click on Cell E5 on the worksheet nothing happens. What am I doing wrong? I am running Windows XP, Excel OFFXL7 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launching a Macro bt Double Clicking
Try:
Private Sub Woorksheet_BeforeDoubleClick_(ByVal Target As Range, Cancel As Boolean) If Target.Address = "$E$5" Then Cancel = True Call Find2 End If End Sub "jswalsh33" wrote: I would like to launch an Excel macro by double clicking on a cell in an Excel worksheet. I used one of your answers to a similar question and wrote the following code in the "View Code" area of the worksheet. Private Sub Woorksheet_BeforeDoubleClick_(ByVal Target As Range, Cancel As Boolean) If Target.Address = "$E$5" Then Call Find2 End If End Sub If I then click on Cell E5 on the worksheet nothing happens. What am I doing wrong? I am running Windows XP, Excel OFFXL7 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launching a Macro bt Double Clicking
Hi,
There's nothing wrong with the code and you have it in the correct place so a couple of possibilities:- Do you have macros disabled i.e. did you eanble them when you opened this workbook. have you accidently disabled events? Put this sub into your workbook and run it Sub aaa() Application.EnableEvents = True End Sub The code will only work on the sheet where you inserted the code and not all sheets. Are you double clicking E5 in the correct sheet? Mike "jswalsh33" wrote: I would like to launch an Excel macro by double clicking on a cell in an Excel worksheet. I used one of your answers to a similar question and wrote the following code in the "View Code" area of the worksheet. Private Sub Woorksheet_BeforeDoubleClick_(ByVal Target As Range, Cancel As Boolean) If Target.Address = "$E$5" Then Call Find2 End If End Sub If I then click on Cell E5 on the worksheet nothing happens. What am I doing wrong? I am running Windows XP, Excel OFFXL7 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Launching a Macro bt Double Clicking
I tried both of these suggestions and got the same results. The macro is not
launched. What does happen is the cell (E5) is selected with the cursor in the cell. Cell E5 contains data that is used by the macro to search for a name on another worksheet. "Mike H" wrote: Hi, There's nothing wrong with the code and you have it in the correct place so a couple of possibilities:- Do you have macros disabled i.e. did you eanble them when you opened this workbook. have you accidently disabled events? Put this sub into your workbook and run it Sub aaa() Application.EnableEvents = True End Sub The code will only work on the sheet where you inserted the code and not all sheets. Are you double clicking E5 in the correct sheet? Mike "jswalsh33" wrote: I would like to launch an Excel macro by double clicking on a cell in an Excel worksheet. I used one of your answers to a similar question and wrote the following code in the "View Code" area of the worksheet. Private Sub Woorksheet_BeforeDoubleClick_(ByVal Target As Range, Cancel As Boolean) If Target.Address = "$E$5" Then Call Find2 End If End Sub If I then click on Cell E5 on the worksheet nothing happens. What am I doing wrong? I am running Windows XP, Excel OFFXL7 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Double Clicking File | Excel Discussion (Misc queries) | |||
How can I use VB code to execute macro when double-clicking cell? | Excel Programming | |||
Launching a macro by double-clicking on active cell | Excel Programming | |||
Double Clicking | New Users to Excel | |||
Double-clicking entry | Excel Programming |