ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help whit hyperlink (https://www.excelbanter.com/excel-programming/271474-help-whit-hyperlink.html)

Didier Lizard

help whit hyperlink
 
Hi !

In the range a1:a100 I have a list of song's title.
In range b1:b100 I have the file's name.

The question is how in VBA I can give this file name added to the dir name
as an hyperlink of the song title ?
So if I clik on that song it goes on playing.

I've tried something like that

dirname="c:\mySongs\"
for i=1 to 100
worksheets(sheet1).range("a1:a100").hyperlinks(i). Subaddress=dirname &
worksheets(sheet1).cell("b" & i)
next i

but it does not work

Thanks tou you

Didier


--

Retirer noPub
Take off noPub



Don Guillett[_4_]

help whit hyperlink
 
Perhaps a DOUBLE click one liner would be of some help
right click sheet tabview codepaste thissave workbook.
assumes you are clicking on a cell with the full file name without .mp3 at
end
you will get C:\yourfolder\yourfilename.mp3
If you have .mp3 at the end, simply delete the &".mp3" part

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
ActiveWorkbook.FollowHyperlink Address:= _
"C:\yourfolder\" & ActiveCell & ".mp3"
End Sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Didier Lizard" wrote in message
...
Hi !

In the range a1:a100 I have a list of song's title.
In range b1:b100 I have the file's name.

The question is how in VBA I can give this file name added to the dir name
as an hyperlink of the song title ?
So if I clik on that song it goes on playing.

I've tried something like that

dirname="c:\mySongs\"
for i=1 to 100
worksheets(sheet1).range("a1:a100").hyperlinks(i). Subaddress=dirname &
worksheets(sheet1).cell("b" & i)
next i

but it does not work

Thanks tou you

Didier


--

Retirer noPub
Take off noPub






All times are GMT +1. The time now is 08:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com