Results 1 to 5 of 5

Thread: Create Hyperlinks based on selection and cell contents

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question Create Hyperlinks based on selection and cell contents

    hello all and thanks in advance

    im trying to create a macro whereby a user can select a range of cells, runs a macro and a hyperlink is automatically to each cell. The hyperlink will be a combination of static text and whatever is in each cell.

    below is what i have started - it is adding a hyperlink to all the cells, but the problem is the actual hyperlink URL is not updating for each subsequent cell and its contents - it is showing the same hyperlink for all cells based on the first active cell

    thanks
    Shaun

    Sub Hyperlink()
    Dim newRange As Range
    Dim newCell As Range
    Set newRange = Selection
    For Each newCell In newRange
       With ActiveSheet
          .Hyperlinks.Add Anchor:=newRange, _
          Address:="pronto:%20/u/pronto/data/L25%20drilldown%20job-code%20" & ActiveCell.Text, TextToDisplay:=ActiveCell.Text
       End With
    Next newCell
    End Sub
    Last edited by Aussiebear; 03-18-2023 at 03:13 PM. Reason: Added code tags to supplied code

Posting Permissions

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