excel room

事務作業で役に立つエクセル関数などを解説します。

ハイパーリンクのマクロコード

Sub macro()
Dim i As Long
For i = 2 To Range("A" & Rows.Count).End(xlUp).Row
If Dir("○○" & Range("A" & i).Value & ".pdf") <> "" Then
With ActiveSheet.Hyperlinks
.Add anchor:=Range("A" & i), _
Address:="○○" & Range("A" & i).Value & ".pdf"
End With
End If
Next

End Sub