Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro button
I have placed a button on a worksheet with a macro assigned to it. Is it
possible to have a "tool " appear when I hover the mouse over it? Thanks in advance for any help. Debbie |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro button
Correction to my post:
I said that the statement "CommandButton1.Visible = True" will be requied to make the tool visible. This incorrectly identified the command button instead of the "tool" as you refer to it. The code should identify the tool you want to make visible. If it was the first shape object added to the worksheet then I would suggest: "ActiveSheet.Shapes(1).Visible = True" or something similar. Regards, Greg -----Original Message----- Assuming you mean a button from the Forms toolbar, then the answer is no. That's not absolutely true; however, the solution would require complex use of API code and would not very likely be worth the effort. However, you can achieve this using a command button from the Control Toolbox toolbar. You cannot assign a macro to a control from the Control Toolbox but you can write event handler code for the control. Access the Control Toolbox toolbar the same as you did for the Forms toolbar. After adding a control to the worksheet, to add event handler code: 1) Right click the sheet tab and select View Code. The worksheet code module will then be displayed. 2) Select the name of the control in the left dropdown list at the top of the worksheet code module. For instance, if you added a command button on the worksheet then it will probably be "CommandButton1". 3) Select the event handler code option from the right dropdown list. In this case you will want "MouseMove". 4) The following code will then be copied to the code module: Private Sub CommandButton1_MouseMove(ByVal Button As _ Integer, ByVal Shift As Integer, ByVal X As Single, _ ByVal Y As Single) End Sub The statement "CommandButton1.Visible = True" will be required to make the control visible when you position the mouse pointer over the control (assuming it was invisible to start). However, moving the mouse pointer away from the control will not return it to an invisible state. Suggested is that you support this with a macro assigned to the click event of the "tool". Note that event handler code can also call a macro. Therefore, indirectly, you can assign a macro to a Control Toolbox control. Regards, Greg -----Original Message----- I have placed a button on a worksheet with a macro assigned to it. Is it possible to have a "tool " appear when I hover the mouse over it? Thanks in advance for any help. Debbie . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use Macro To Change Which Macro Assigned To Command Button | Excel Discussion (Misc queries) | |||
Macro Button! help! | Excel Discussion (Misc queries) | |||
Using Macro to sort without clicking on macro button | Excel Discussion (Misc queries) | |||
Cannot see macro behind button? | Excel Discussion (Misc queries) | |||
use macro button to run macro in protected sheet | Excel Discussion (Misc queries) |