Sub tourl()
Range("a2").Select
For i = 1 To 100
s = Selection.Value
If s = "" Then GoTo EndNext
'create excel hotlink
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:="h:\recorded tv\" & s
EndNext:
Selection.Offset(1).Select
Next
End Sub
My tech exploits. Nah... closer to a tech diary, and work log, so if I forget something, but know I forgot, I'll maybe be able to look it up here. And as a bonus, perhaps someone out there will find it useful or interesting. As is only fair, being nearly all the information put here was gleaned from elsewhere on the web.
Wednesday, May 11, 2011
VB macro to create excel url hotlink from filename
Here's a VB classic (circa VBA 2000) excel macro to automatically take filename text and create a file:// url out of it, making the cell into a hotlink.
specs:
Filenames are in column a
Starts at row 2, processing 100 rows
Skips empty entries
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment