code WORKS for showing 'screen tip' when cursor hovers (as hyperlink), but how to use it for multiple objects?

kbishop94

Active Member
Joined
Dec 5, 2016
Messages
476
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
using this code I am able to have a hyperlink (not active, nothing happens when you click on it) so that it shows a "screen tip" (showing the 'date of hire'. This is for an Org chart I am working on.) But i only can get it to work with 1 object. Will I have to have a separate macro for each object, or is it possible to have one macro provide different screen tips for each object?

code:
Code:
Sub ShowDOH()

    Dim RM_agro As Range
    Set RM_agro = Selection

    ActiveSheet.Shapes.Range(Array("RM_agro")).Select [B][COLOR=#006400]' Richard Mullins[/COLOR][/B]
    ActiveSheet.Hyperlinks.Add _
        Anchor:=Selection.ShapeRange.Item(1), _
        Address:="", _
        ScreenTip:="date of hire: 11-1-2017"

    RM_agro.Select
    
End Sub

the above Macro shows this when the cursor is hovered above the shape "RM_agro":

2rpe1qh.jpg


Here is code for where i am attempting to do the same thing as above, but with multiple objects and inside one macro. Is this possible or do I need to use a separate macro for each object? (OR.. better question, is there a better/easier way to do this where I can show a "screen tip" for each object than what I am attempting to do?) Please and Thank you for any help on this.

Code:
Sub ShowDOH()
    Dim RM_agro As Range
    Dim JN_cfo As Range
   
    Set RM_agro = Selection
    Set JN_cfo = Selection
 
    ActiveSheet.Shapes.Range(Array("RM_agro")).Select [B][COLOR=#006400]' Richard Mullins[/COLOR][/B]
    ActiveSheet.Hyperlinks.Add _
        Anchor:=Selection.ShapeRange.Item(1), _
        Address:="", _
        ScreenTip:="date of hire: 11-1-2017"
 
    ActiveSheet.Shapes.Range(Array("JN_cfo")).Select [B][COLOR=#006400]' Jim Nattier[/COLOR][/B]
    ActiveSheet.Hyperlinks.Add _
        Anchor:=Selection.ShapeRange.Item(1), _
        Address:="", _
        ScreenTip:="date of hire: 5-1-2007"
       
    JN_cfo.Select
    RM_agro.Select

End Sub
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Using this approach, you would have to make a hyperlink for each shape that has a pseudo-tool-tip
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,719
Members
452,995
Latest member
isldboy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top