+ Reply to Thread
Results 1 to 11 of 11

Excel changes hyperlink name on me. What gives!

  1. #1
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Question Excel changes hyperlink name on me. What gives!

    I have a macro that makes a hyperlink for every file in a specific folder. I recently changed my filename stucture from 40408E(1), 40408E(2), etc. to 40408E1 and 40408E(2) (these are just examples).

    Now... when excel creates a hyperlink, it doesn't give me 40408E1 it gives me 4.04E+05 and 4.04E+06


    How can I have excel give the exact hyperlink I want? Is it possible?

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Excel changes hyperlink name on me. What gives!

    Try the FORMAT() function
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    That doesn't do anything.

  4. #4
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    That doesn't do anything.

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Excel changes hyperlink name on me. What gives!

    Can you post the spreadsheet or copypasta the macro definition into a CODE tag?

  6. #6
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    Ben, Proton, as you can see, when I get a list of hyperlinks (which is what I want), it assumes 40408E1 should say 4.04+05... that's not what I want it to say.

    Here is the code I use.

    PHP Code: 
    Sub Photo_Hyperlinks2()
    Dim fsfolfilcounti
    count 
    1
    Set fs 
    CreateObject("Scripting.filesystemobject")
    Set fol fs.getfolder(Range("Checksheet!U4")) 'Change This Every Month
    For Each fil In fol.Files
        i = Len(fil.Name)
        Do Until Mid(fil.Name, i, 1) = "."
            i = i - 1
        Loop
        Range("A" & count).Select
        ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=fil.Path, TextToDisplay:=Left(fil.Name, i - 1)
        count = count + 1
    Next
    End Sub 
    I hope this helps.
    Attached Images Attached Images

  7. #7
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    Ben, Proton, as you can see, when I get a list of hyperlinks (which is what I want), it assumes 40408E1 should say 4.04+05... that's not what I want it to say.

    Here is the code I use.

    PHP Code: 
    Sub Photo_Hyperlinks2()
    Dim fsfolfilcounti
    count 
    1
    Set fs 
    CreateObject("Scripting.filesystemobject")
    Set fol fs.getfolder(Range("Checksheet!U4")) 'Change This Every Month
    For Each fil In fol.Files
        i = Len(fil.Name)
        Do Until Mid(fil.Name, i, 1) = "."
            i = i - 1
        Loop
        Range("A" & count).Select
        ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=fil.Path, TextToDisplay:=Left(fil.Name, i - 1)
        count = count + 1
    Next
    End Sub 
    I hope this helps.

  8. #8
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    Sorry guys, for some reason the attachment didn't go through.

    Now... as you can see, when I get a list of hyperlinks (which is what I want), it assumes 40408E1 should say 4.04+05... that's not what I want the hyperlink to say.
    Attached Images Attached Images

  9. #9
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    So now that you guys can see what excel does... anyway to have excel give me the hyperlink name the way the filename is?
    Where is the FORMAT() formula supposed to help here?

  10. #10
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    Any ideas to have the hyperlink names be what the file name is?

  11. #11
    Forum Contributor
    Join Date
    10-23-2004
    Location
    Los Angeles
    MS-Off Ver
    2010
    Posts
    253

    Re: Excel changes hyperlink name on me. What gives!

    Any ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010 Create a macro to check if cell contains hyperlink then apply hyperlink style
    By chasidar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-12-2013, 04:48 AM
  2. Replies: 1
    Last Post: 02-23-2013, 05:18 AM
  3. Replies: 5
    Last Post: 06-22-2006, 07:10 AM
  4. Replies: 0
    Last Post: 03-26-2006, 07:10 PM
  5. [SOLVED] Intra-workbook hyperlink: macro/function to return to hyperlink ce
    By marika1981 in forum Excel General
    Replies: 3
    Last Post: 05-06-2005, 01:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1