カメニッキ

カメとインコと釣りの人です

Excelで選択範囲を一括ハイパーリンク化するVBAマクロ

Sub url_set()
oColumn = Selection.Column
oRow = Selection.Row
owidth = Selection.Columns.Count
ohight = Selection.Rows.Count

For i = 0 To owidth - 1
For j = 0 To ohight - 1
setdata = Cells(j + oRow, i + oColumn)
If setdata <> "" Then
Cells(j + oRow, i + oColumn).Hyperlinks.Add Anchor:=Cells(j + oRow, i + oColumn), Address:=setdata
End If
Next j
Next i
End Sub