Consulting

Results 1 to 4 of 4

Thread: Putting in 1,000's of hyperlinks.

  1. #1
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location

    Putting in 1,000's of hyperlinks.

    Hi,

    I need some more help please. I?m attaching a workbook cos it?ll be easier to see what I?m on about.

    On all sheets there are codes for "modules". And what I want to do is put hyperlinks in. So...

    On "Matrix1" sheet, the modules appear in column B and are formatted green. I want to automatically get each cell to link to its counterpart on "module description" sheet, and vice versa. I have done one already, (the 3AO01 point to each other from both sheets when you click them). Not all modules on Matrix1 have a counterpart on "module description", so in these cases nothing would happen.

    On Matrix2 the modules appear in row2, but I?m looking to do the same thing here too (for them to point to the correct cell on "module description")

    Trickier on "All golden paths" because the module names appear thousands of times in the main data area ? but if it is possible, I would like the same thing done there too).

    On module description, I just need the hyperlinks to point to the correct cells on Matrix1.

    Any help on this will as usual be greatly appreciated.

    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  2. #2
    Knowledge Base Approver
    The King of Overkill!
    VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Hey Babydum,

    This should work as needed:[vba]Sub RunIt()
    Application.ScreenUpdating = False
    With Sheets("Module Description")
    HelpBabydum Sheets("Matrix1").Range("B4:B233"), .Columns("C")
    HelpBabydum Sheets("Matrix2").Range("C2:HU2"), .Columns("C")
    HelpBabydum Sheets("All Golden Paths").Range("B4:FQ255"), .Columns("C")
    HelpBabydum .Range("C3:C158"), Sheets("Matrix1").Columns("B")
    End With
    Application.ScreenUpdating = True
    End Sub
    Sub HelpBabydum(ByVal SourceRG As Range, ByVal DestRG As Range)
    Dim SrcWS As Worksheet, DestWS As Worksheet, CLL As Range, FND As Range
    Set SrcWS = SourceRG.Parent
    Set DestWS = DestRG.Parent
    For Each CLL In SourceRG.Cells
    If Len(Trim(CLL.Text)) > 0 Then
    Set FND = DestRG.Find(CLL.Value, LookAt:=xlWhole)
    If Not FND Is Nothing Then
    SrcWS.Hyperlinks.Add CLL, "", "'" & DestWS.Name & "'!" & FND.Address(0, 0)
    End If
    End If
    Next 'CLL
    End Sub[/vba]Matt

  3. #3
    VBAX Mentor Sir Babydum GBE's Avatar
    Joined
    Mar 2005
    Location
    Cardiff, UK
    Posts
    499
    Location
    Matt,

    That's pewer genius ("pure genius" with a welsh accent)

    Thanks man.
    Have a profound problem? Need a ridiculous solution? Post a question in Babydum's forum

  4. #4
    Knowledge Base Approver
    The King of Overkill! VBAX Master
    Joined
    Jul 2004
    Location
    Rochester, NY
    Posts
    1,727
    Location
    Glad to help!

Posting Permissions

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