+ Reply to Thread
Results 1 to 5 of 5

Shape Hyperlink Screentip macro

Hybrid View

andy1787 Shape Hyperlink Screentip... 09-27-2011, 12:38 PM
andy1787 Re: Shape Hyperlink Screentip... 09-27-2011, 03:04 PM
SMChacko Re: Shape Hyperlink Screentip... 09-27-2011, 04:02 PM
andy1787 Re: Shape Hyperlink Screentip... 09-27-2011, 06:42 PM
andy1787 Re: Shape Hyperlink Screentip... 09-28-2011, 10:42 AM
  1. #1
    Registered User
    Join Date
    09-27-2011
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Shape Hyperlink Screentip macro

    Hello,

    I am currently trying to make a macro that will update a shapes hyperlink screentip. I am using a range that has my data and shape names. Please let me know what is the matter with the current macro I have been trying to develop.

    I have attached my excel file, which contains only the bare essential information that you would need to understand what my goal is. the hyperlinks have already been created to go to sheets that I have deleted because of sensitive data.


    Sub RPMStates()
    '
    '
    '
    Dim cstate As Integer
    Dim StateName As String
    Dim StateValue As Integer
    Dim rngstates As Range

    Set rngstates = Range(ThisWorkbook.Names("rpm").RefersTo)

    With Worksheets("map")
    For cstate = 1 To rngstates.Rows.Count
    StateName = rngstates.Cells(intState, 1).Text
    StateValue = rngstates.Cells(intState, 5).Value

    Shape.Range(Array(StateName)).Select
    Selection.ScreenTip = StateValue

    Next
    End With

    End Sub


    Thank you for your time,
    Andy
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    09-27-2011
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Shape Hyperlink Screentip macro

    I really could use your expert opinions on this one.

    Thanks

  3. #3
    Registered User
    Join Date
    05-25-2010
    Location
    God's Own Country
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Shape Hyperlink Screentip macro

    Sub RPMStates()
    
        Dim intState As Integer
        Dim strStateName As String
        Dim intStateValue As Single
        Dim rngstates As Range
        
        Set rngstates = ThisWorkbook.Worksheets("Summary by Region").Range("rpm")
        
        With Worksheets("map")
            For intState = 1 To rngstates.Rows.Count
                strStateName = rngstates.Cells(intState, 1).Text
                intStateValue = rngstates.Cells(intState, 5).Value
               .Hyperlinks.Add Anchor:=.Shapes(strStateName), Address:="", ScreenTip:=CStr(intStateValue)
            Next intState
        End With
    
    End Sub

  4. #4
    Registered User
    Join Date
    09-27-2011
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Shape Hyperlink Screentip macro

    SMchacko

    Thank you for your post. The new additions to the macro worked perfectly.
    Last edited by andy1787; 09-27-2011 at 06:53 PM.

  5. #5
    Registered User
    Join Date
    09-27-2011
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Shape Hyperlink Screentip macro

    How would I code the above hyperlinks.add line to make the hyperlink go to a worksheet in the workbook I am working with?

    Thanks

+ 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