+ Reply to Thread
Results 1 to 4 of 4

Automatically changing screentip for "each"/"every" hyperlink in worksheet?

Hybrid View

  1. #1
    Registered User
    Join Date
    10-02-2015
    Location
    Pennsylvania
    MS-Off Ver
    2007
    Posts
    33

    Question Automatically changing screentip for "each"/"every" hyperlink in worksheet?

    Hi All,

    The script below works by adding a hyperlink with a custom screentip on-the-fly. However, the custom screentip only displays on the 1st hyperlinked cell.

    - Does anyone know how to get the "custom" screentip to show on "EACH" hyperlink being created, on-the-fly?
    or if that's not possible, does anyone know how to update "EVERY" hyperlink with custom screentip on-the-fly (instead of just the 1st)

    Private Sub Worksheet_Change(ByVal Target As Range)
        
      On Error Resume Next
      If Not Target.Value = "" And Not Target.Row = 1 And Not Target.Row = 2 Then
        If Target.Value >= 1 And Target.Value <= 9999 Then
          Application.EnableEvents = False
          Hyperlinks.Add Target, Address:="http://www.internalsite.com/value?" & Target.Value
          Hyperlinks.ScreenTip = "Click to load item #" & Target.Value & vbLf & "Hold down mouse button 2-Seconds to Edit"
          Application.EnableEvents = True
        End If
      
      End If
    
    EndSub
    ps: This is using Excel 2007. Thanks so much, JMC

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Automatically changing screentip for "each"/"every" hyperlink in worksheet?

    See if this cures it.

    Private Sub Worksheet_Change(ByVal Target As Range)
        
      On Error Resume Next
      If Not Target.Value = "" And Not Target.Row = 1 And Not Target.Row = 2 Then
        If Target.Value >= 1 And Target.Value <= 9999 Then
          Application.EnableEvents = False
          Hyperlinks.Add Target, Address:="http://www.internalsite.com/value?" & Target.Value, _
          ScreenTip:="Click to load item #" & Target.Value & vbLf & "Hold down mouse button 2-Seconds to Edit"
          Application.EnableEvents = True
        End If
      
      End If
    
    End Sub
    edit:-
    And some additional code to fix the existing hyperlinks.
    Sub fix_links()
    Dim hlink As Hyperlink
    Application.EnableEvents = False
    For Each hlink In ActiveSheet.Hyperlinks
        hlink.ScreenTip = "Click to load item #" & hlink.Range.Value & vbLf & "Hold down mouse button 2-Seconds to Edit"
    Next
    Application.EnableEvents = True
    End Sub
    Please note: both procedures are untested.
    Last edited by jason.b75; 10-03-2015 at 12:52 PM.

  3. #3
    Registered User
    Join Date
    10-02-2015
    Location
    Pennsylvania
    MS-Off Ver
    2007
    Posts
    33

    Re: Automatically changing screentip for "each"/"every" hyperlink in worksheet?

    Solved! Thank you so much, Jason! And thank you for the quick reply too! Your suggestion worked beautifully!! -JMC

  4. #4
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Automatically changing screentip for "each"/"every" hyperlink in worksheet?

    You're welcome.

    In case you didn't notice, I did add an extra piece of code for you to fix the existing hyperlinks.

    If you're happy that your query has been resolved could you please flag it as solved in the thread tools menu (just above post #1, on the right)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. "Worksheet change" not changing cell on other sheet to match target cell "fill".
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-02-2015, 12:02 PM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. [SOLVED] Changing zeros in a worksheet to their "column" "Row 1" value
    By markthehousebuyer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-12-2013, 10:23 PM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  6. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  7. [SOLVED] Changing "returned" values from "0" to "blank"
    By LATATC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2005, 12:05 PM

Tags for this Thread

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