+ Reply to Thread
Results 1 to 6 of 6

Macro Buttons explanatory text?

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2007
    Posts
    47

    Question Macro Buttons explanatory text?

    Hello Gurus,

    I have some VBA procedures in my workbook and assigned those to buttons in a worksheet. But it's cumbursome - for example, one button is called (the text within the rectangle shape) "Download Country Financial Forecast". Well, this is too long (knowing that I have a dozen of buttons). What I would like to do is to put an abreviation "DCFF" into the rectangle shape instead of the entire text; and when I put my cursor over that button I want to see in a pop-up (comment like) manner "Downlaod Country Financial Forecast" prompt text.

    Just like in this forum when I put my mouse cursor over a topic name in the list of topics I see some text in a small pop-up window.

    Does any one know how to do that?

    Thanks a lot!

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Macro Buttons explanatory text?

    Hello kyrgyzstanart,

    Add a hyperlink to your shape and hyperlink to cell behind the shape. Set the screen tip to display what you want when the mouse moves on to the shape.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    02-22-2007
    Posts
    47

    Question Re: Macro Buttons explanatory text?

    Quote Originally Posted by Leith Ross View Post
    Hello kyrgyzstanart,

    Add a hyperlink to your shape and hyperlink to cell behind the shape. Set the screen tip to display what you want when the mouse moves on to the shape.
    Hello Leith Ross,

    Thank you for the tip, but it doesn't work. When the button gets a hyperlink - when I click on the button it doesn't run the macro assigned to it but simply sends to the cell "behind the shape.

    Here is what I found at http://excel.tips.net/Pages/T003294_..._an_Image.html

    "You might at first think that you could add a ScreenTip to the image, but that can only be done if you assign a hyperlink to it. Adding the hyperlink (and ScreenTip) is easy enough, but you'll find that the hyperlink takes precedence over the macro, stopping it from being run."

    But their way is not the most streight forward, I was wondering if somebody on the forum has done something like this.

    Please, advise.
    Last edited by kyrgyzstanart; 01-03-2010 at 10:18 AM.

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: Macro Buttons explanatory text?

    Try it out, tell us how it goes.

    Another option could be a Hyperlink Macro,
    http://www.excelforum.com/excel-prog...-question.html

    Click Here for an Example
    Last edited by davesexcel; 01-03-2010 at 10:54 AM.

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro Buttons explanatory text?

    Another option would be to add a small shape (like a circle with a question mark in it) on top of your "button" and assign the hyperlink / screen tip to that. Hovering over the smaller shape gives the text you want in the pop-up but the larger shape is still available for clicking and running your macro.

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Macro Buttons explanatory text?

    What you could use is the Comment of the Cell beneath.
    Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    
    Static busy As Boolean
    
    If busy = False Then
      busy = True
      If X > 10 And X < 40 And Y > 10 And Y < 40 Then
        Call Module1.SetComment(CommandButton1.TopLeftCell, 1) 'On
      Else
        Call Module1.SetComment(CommandButton1.TopLeftCell, 0) 'Off
      End If
      busy = False
    End If
    
    End Sub
    and in Module1
    Sub SetComment(MyCell As Range, OnOff As Integer)
        If MyCell.Comment Is Nothing Then
          MyCell.AddComment
          MyCell.Comment.Text Text:="Show this text"
        Else
          MyCell.Comment.Text Text:="Show this text"
        End If
        
        If OnOff = 0 Then 'Off
          MyCell.Comment.Visible = False
        ElseIf OnOff = 1 Then
          MyCell.Comment.Visible = True
        End If
    
    End Sub
    see My atachement and hoover over CB1.
    Attached Files Attached Files
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1