#1   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 15
Default Hyperlink display

I have the file path to several files of mine in columb A.
In columb B, I use =hyperlink(A1) and copy down.

The hyperlinks work fine but I only want to display the actual file
name.

example instead of

- G:\Staff Duty Book Folders V2\Book Cover.doc

I want it to display

- Book Cover

Any suggestions I am totally lost on this.
Thanks in advance

  #2   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 459
Default Hyperlink display

QTGlennM wrote:
I have the file path to several files of mine in columb A.
In columb B, I use =hyperlink(A1) and copy down.

The hyperlinks work fine but I only want to display the actual file
name.

example instead of

- G:\Staff Duty Book Folders V2\Book Cover.doc

I want it to display

- Book Cover

Any suggestions I am totally lost on this.
Thanks in advance


Maybe it's a little bit long, but I think it should work:

=MID(SUBSTITUTE(A10,"\","]",LEN(A10)-LEN(SUBSTITUTE(A10,"\",""))),FIND("]",SUBSTITUTE(A10,"\","]",LEN(A10)-LEN(SUBSTITUTE(A10,"\",""))))+1,LEN(A10)-FIND("]",SUBSTITUTE(A10,"\","]",LEN(A10)-LEN(SUBSTITUTE(A10,"\",""))))-4)

where in A10 you have your path with filename.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


  #3   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 903
Default Hyperlink display

If I understand you correctly you have a complete pathname
in Column A (no link) and you want to create a HYPERTEXT Worksheet
Function in B that shows the filename but links to the full pathname.
You will still have the full pathname in Column A showing and the
formula in column B will be dependent on the value in Column A.


Private Function ExtractFilename(cell) As String
Dim str As String, newstring As String
str = cell
If InStr(str, "\") = 0 Then
ExtractFilename = str
Exit Function
End If
newstring = Mid(str, InStrRev(str, "\", , vbTextCompare) + 1)
If InStr(newstring, ".") = 0 Then
ExtractFilename = newstring
Exit Function
End If
str = Left(str, InStr(newstring, ".") - 1)
ExtractFilename = str
End Function


a2: G:\Staff Duty Book Folders V2\Book Cover.doc
b2: =Hyperlink(a2,ExtractFilename(a2))

If you were extracting the hyperlink from A2 the following
function would work --- but I don't think that is what you are doing.

Private Function HyperlinkFilename(cell) As String
Dim str As String, newstring As String
str = cell.Hyperlinks(1).Address
If cell.Hyperlinks.Count < 1 Then Exit Function
If InStr(str, "\") = 0 Then
HyperlinkFilename = str
Exit Function
End If
newstring = Mid(str, InStrRev(str, "\", , vbTextCompare) + 1)
If InStr(newstring, ".") = 0 Then
HyperlinkFilename = newstring
Exit Function
End If
str = Left(str, InStr(newstring, ".") - 1)
HyperlinkFilename = str
End Function




---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"QTGlennM" wrote in message ups.com...
I have the file path to several files of mine in columb A.
In columb B, I use =hyperlink(A1) and copy down.

The hyperlinks work fine but I only want to display the actual file
name.

example instead of

- G:\Staff Duty Book Folders V2\Book Cover.doc

I want it to display

- Book Cover

Any suggestions I am totally lost on this.
Thanks in advance



  #4   Report Post  
Posted to microsoft.public.excel.links
external usenet poster
 
Posts: 473
Default Hyperlink display

=HYPERLINK(A1,MID(LEFT(A1,FIND(".",A1)-1),MAX(ROW(INDIRECT("1:"&LEN(A1)
))*(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)="\"))+1, 255))

entered as an array formula with Ctrl+Shift+Enter.
It assumes there will be at least one "\" in the file name and a . in
only the file name part.

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I display the full file path for a hyperlink in Office 2003 Worthy Excel Discussion (Misc queries) 6 June 25th 06 04:19 PM
How to hyperlink to an image on a different sheet and display it f twilliams New Users to Excel 1 February 10th 06 03:11 AM
Hyperlink to a location on worksheet and display full image. twilliams Excel Discussion (Misc queries) 1 February 7th 06 10:06 PM
Hyperlink display text maximum in Excel 2003 CTC Excel Discussion (Misc queries) 2 May 25th 05 07:17 PM
How do I display hyperlink in Excel cell? Erich Excel Discussion (Misc queries) 2 May 15th 05 12:19 AM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"