Print a range of hyperlinks

How to do this to print the hyperlink files found in the "D: E" columns by selecting the rows in the "A" column

Sub Print_Hyperlinks()

    Dim rng     As Range
    Dim row     As Range
    Dim cell    As Range
    Dim LastRow As Long


    LastRow = Range("A2").End(xlDown) 'Print only selected rows in "A"

    Set rng = Range("D2:E" & LastRow)

    For Each row In rng.Rows
      For Each cell In row.Cells
           Selection.Hyperlinks(1).Follow   'List of Hyperlinks in Column "D"
           Selection.Hyperlinks(2).Follow   'List of Hyperlinks in Column "E"
      Next cell
    Next row

End Sub
+3
source share
1 answer

You need to refer to the last row, not the data in it, i.e. replace

LastRow = Range ("A2"). End (xlDown) 'Print only selected lines in "A" with LastRow = Range ("A2"). End (xlDown) .row 'Print only selected lines in "A"

Chris

0
source

Source: https://habr.com/ru/post/1751861/


All Articles