开发者

Print a range of hyperlinks

How can I get this to print the hyperlinks files found in columns "D:E" by selecting the rows in column "A"

Sub Print_Hyperlinks()

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


    LastRow = Range("A2").End(x开发者_运维知识库lDown) '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


YOu need to reference the last row not the data therein i.e. replace

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

Chris

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜