Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default Make more info appear when mouse moves over a macro command button

Do you mean like a tooltip, a text box that pops up when you are over the
button? CommandButtons have a MouseMove event that can trigger code when the
mouse is over them (but only CommandButtons from the Controls Toolbox; not
the Forms Toolbar!). The only thing is I can't (yet) find a way to run code
to make the box go away automatically if you move off the button. But here
is what you can do at least get started:

Create the CommandButton from the Toolbox, and put a textbox nearby - set
them up so they appear the way you want them to appear when the textbox
shows, but when done set the TextBox's Visible property to be False.

Now you need to go into the VBA editor and make sure the Project Explorer is
showing. In there, select the line that shows the worksheet where your
button is. Then, in the code pane put the following (note: assumes your
button's name is CommandButton1 and TextBox is TextBox1):

Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

TextBox1.Visible = True

End Sub

Now when you mouse over the button the textbox the textbox should pop up.
But as I said there is no way I found to make it disappear if you then move
the mouse away from the button - you may need to put another "Close" button
that appears as "part of" your textbox (i.e. on top of it), then do this:

Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)

TextBox1.Visible = True
CommandButton2.Visible = True

End Sub

Private Sub CommandButton2_Click()

TextBox1.Visible = False
CommandButton2.Visible = False

End Sub

A little bit crude, but functional. Perhaps might meet your needs.

"Jeff at Bosch Corp." wrote:

I am a first user to macros. I am trying to make a flow chart where there is
only numbers visible on the command button, but when a user slides the mouse
over the button, more information appears such as what happens when you add a
comment to a cell. Also when the user clicks on the button it will link to
another spreadsheet, however I already have this linking system set up.

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
Command button moves even with don't move or resize checked. kelee Excel Discussion (Misc queries) 4 October 14th 08 01:11 PM
Command Button Info FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 2 September 4th 07 05:22 PM
Command Button Moves when sheet printed DarbyDog Excel Discussion (Misc queries) 2 September 22nd 05 03:24 PM
Command Button Moves Matto Excel Programming 1 February 17th 05 08:22 PM
command button moves Stuart Excel Discussion (Misc queries) 2 December 15th 04 05:56 PM


All times are GMT +1. The time now is 05:50 AM.

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

About Us

"It's about Microsoft Excel"