Consulting

Results 1 to 6 of 6

Thread: VBA - MouseMove Event Code to Display Text after Hovering

  1. #1

    VBA - MouseMove Event Code to Display Text after Hovering

    Good Afternoon Forum Members!

    I am new to VBA Express and am looking forward to learning a lot.

    Here is my issue. I've added MouseMove code to CommandButtons in order to display text when a user hovers over the command button. However, I realized that now the user cannot actually click the button to perform the respective function. Please help! I've taken a VBA course many years ago, so basically I'm a complete novice. I am using Excel/VBA 2010.


    This is a modification request to provide users the ability to mouse over a command button to view a description and also select/click the same command button to perform the related function.

    Here is an example of the current code:

    Private Sub CommandButton13_MouseMove(ByVal Button As Integer, ByVal Shift As Integer,


    ByVal X As Single, ByVal Y As Single)
    MsgBox "Validate Amounts "
    End Sub

    Many thanks in advance for your assistance, knowledge and expertise.

    Simone
    Last edited by sollijones; 08-05-2013 at 01:19 PM. Reason: omitted information

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Is this command button on a sheet or a userform? If the latter it has a ControlTipText Property which pops up a box when you hover over the button which you can set to be descriptive of what the button does.
    If it's on a sheet, come back.
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    For a sheet's ActiveX CommandButton control, try something like this instead: http://www.mrexcel.com/forum/excel-q...andbutton.html

    I would use a short interval for the message.

  4. #4
    Hi p45cal,

    Thank you for your swift response! The command button is on a sheet. Please see the screenshot below.

    Command Buttons.jpg

    Many thanks.

  5. #5
    Thanks Kenneth. I will take a look at the link.

  6. #6
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Quote Originally Posted by sollijones View Post
    The command button is on a sheet.
    Then perhaps Kenneth's suggestion will do it for you!
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •