+ Reply to Thread
Results 1 to 8 of 8

Assign macro and hyperlink

  1. #1
    pan65
    Guest

    Assign macro and hyperlink

    Is it possible to assign a macro and a hyperlink to a shape I have placed on
    a spreadsheet? The hyperlink seems to take precidence and the macro never
    launches.

    What I really want is for the macro to launch when the shape is clicked and
    for the screen tips of the hyperlink to appear when the mouse hovers over the
    shape.

    Any suggestions.

  2. #2
    scottfoxall
    Guest

    RE: Assign macro and hyperlink

    I may be wrong but I don't think its possable to run two events from the same
    object at the same time?



    "pan65" wrote:

    > Is it possible to assign a macro and a hyperlink to a shape I have placed on
    > a spreadsheet? The hyperlink seems to take precidence and the macro never
    > launches.
    >
    > What I really want is for the macro to launch when the shape is clicked and
    > for the screen tips of the hyperlink to appear when the mouse hovers over the
    > shape.
    >
    > Any suggestions.


  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Assign macro and hyperlink

    Is there a solution for that problem?
    or what can we do to assign a macro to the shape and makes screen tip appear on that shape?

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Assign macro and hyperlink

    How can I make a screen tip to a shape such as oval and at the same time assign macro to that shape?

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Assign macro and hyperlink

    Is my request unclear? or impossible to do that task?

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Assign macro and hyperlink

    I appreciate any reply ..

  7. #7
    Registered User
    Join Date
    06-26-2017
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    1

    Re: Assign macro and hyperlink

    I know this is an old thread, but since I ended here from google and that there are no other info for this, here is a possible answer.

    I used in the destination worksheet.

    Private Sub Worksheet_Activate()
    MsgBox "enter code here"
    End Sub

    This will only work if the shape is the only point of entry for this sheet, otherwise it will always be called when the sheet is first selected.

    Otherwise there is an answer on here : https://www.mrexcel.com/forum/excel-...ick-shape.html
    I think you are better off not trying to use non existent event handler on the shape.

  8. #8
    Valued Forum Contributor
    Join Date
    03-24-2014
    Location
    England
    MS-Off Ver
    Excel 2003 - 2016
    Posts
    575

    Re: Assign macro and hyperlink

    Well....actually......the OP is asking this question because he wants to use a shape (ie a png / bmp) as a button within Excel, however, he also wants a mouse over tooltip to appear to let users know what the button is for......I've done the same thing in a few apps cos apparently double figure IQ'd users can't work out what a 'PASTE HERE' icon looks like without an explanation using short words.

    here's how you do it:

    If you assign a hyperlink to the shape you can then set a mouse over tool tip to appear. However, as the OP notes, you can't have both a macro and a hyperlink assigned to the same shape. To get around this, assign the hyperlink but link it to a hidden cell (I always hide columns A & B as a matter of course). In the code for the worksheet put the macro to run on the selection event for the cell you've just hyperlinked. ie:

    Please Login or Register  to view this content.
    Therefore, the user experience is: Mouse over the paste icon, they see the tooltip that explains this icon will paste clipboard text to the cell below. User clicks paste icon, hyperlink fires and cursor moves to the hidden area.....selection event fires which then triggers the macro that's supposed to run when a user clicks the icon.

    job done.

+ 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