Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

Auto multiple links

閲覧: 115 回
最初の未読メッセージにスキップ

John

未読、
2003/02/26 16:41:092003/02/26
To:
How do I automatically generate links on a spreedsheet to
all of the files in a directory ?

Bill Manville

未読、
2003/02/27 4:58:172003/02/27
To:
John wrote:
> How do I automatically generate links on a spreedsheet to
> all of the files in a directory ?
>

Sub HyperlinksToDirectory()
' puts hyperlinks to each of the files in a directory of your choice
' into the active sheet starting at the active cell
Dim stDir As String
Dim stFile As String
Dim R As Range
Set R = ActiveCell
stDir = InputBox("Directory?", , Default:=CurDir())
stFile = Dir(stDir & "\*.*")
Do Until stFile = ""
R.Hyperlinks.Add R, stDir & "\" & stFile, , , stFile
Set R = R.Offset(1)
stFile = Dir()
Loop
R.CurrentRegion.Sort key1:=R, order1:=xlAscending, header:=xlNo
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup

新着メール 0 件