Consulting

Results 1 to 2 of 2

Thread: Dynamic Hyperlink VBA

  1. #1
    VBAX Newbie
    Joined
    Mar 2020
    Posts
    1
    Location

    Dynamic Hyperlink VBA

    Hi all,

    I have a question regarding making a hyperlink dynamic. Below I have posted my code that I have so far. I want to make the hyperlink in a way where the sub address directs me to cell "ws.Range("E" & count).value". The cell keeps changing as it keeps looping and hence I want to do the same with my hyperlink. Thanks in advance!
    PublicSub tatrigger(ws As Worksheet)
    
        Dim i As Long
        Dim x As Long
        Dim lastRow As Long
        Dim first As Long
        Dim last As Long
        Dim count As Long
        
        Application.ScreenUpdating = False
        
        lastRow = ws.Cells(Rows.count, "C").End(xlUp).Offset(2, 0).row
        first = ws.Range("Trigger_Table").row
        last = ws.Cells(Rows.count, "C").End(xlUp).Offset(-1, 0).row
        
        'looks for tip and copies task name, task descrption, umbrella into bulk add (regardless of duplicates)
        
        For count = first To last
            If ws.Range("C" & count).value = "ta" Then
                ws.Range("E" & count).Copy
                    For i = lastRow To lastRow
                        ws.Range("C" & i + x).PasteSpecial Paste:=xlPasteValues
                        'ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:=ws.Range("E" & count)
                        ws.Range("C" & count).value = "ta- added to takeaways"
                    Next i
                    x = x + 1
            End If
        Next count
        
        Application.CutCopyMode = False
        Application.ScreenUpdating = True EndSub


  2. #2

Posting Permissions

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