Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use Macro To Change Which Macro Assigned To Command Button CVinje Excel Discussion (Misc queries) 0 May 25th 10 09:55 PM
Macro Button! help! TxcPhtm Excel Discussion (Misc queries) 1 February 27th 08 11:26 PM
Using Macro to sort without clicking on macro button dd Excel Discussion (Misc queries) 3 May 3rd 07 06:00 PM
Cannot see macro behind button? Kimberly Anne Excel Discussion (Misc queries) 1 August 31st 06 12:00 AM
use macro button to run macro in protected sheet earl Excel Discussion (Misc queries) 3 February 26th 06 10:21 PM


All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"