+ Reply to Thread
Results 1 to 7 of 7

Convert part of string to Hyperlink Text

  1. #1
    Registered User
    Join Date
    12-07-2015
    Location
    Arizona, USA
    MS-Off Ver
    2016
    Posts
    4

    Question Convert part of string to Hyperlink Text

    I'm looking for a way, i would imagine VBA is the only way to make this possible, to convert a long hyperlink to a short hyperlink text based on the last value after the last forward slash(backslash on networks).

    I.e.

    C:\Users\user\Documents\drawing1.bmp
    C:\Users\user\Documents\anime.bmp
    C:\Users\user\Documents\photo1.bmp
    C:\Users\user\Documents\sketch1.bmp
    C:\Users\user\Documents\picture1.bmp

    Consider these links, now multiply this by infinity amount of sub-folders and document types. I would like to change these path into single filename hyperlinks

    drawing1.bmp
    anime.bmp
    photo1.bmp
    sketch1.bmp
    picture1.bmp

    I have no idea where to start, i would even appreciate it if the only way is to make the next cell column over the new data. I could then delete the previous column and move that one.

    Thanks ahead of time.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Convert part of string to Hyperlink Text

    Try this formula in Next col then copy down
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Edited...
    Sorry you did mention the paths will change...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Assuming the first occurrence is in [A1]
    Last edited by sintek; 07-07-2017 at 03:59 PM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    12-07-2015
    Location
    Arizona, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Convert part of string to Hyperlink Text

    This is a start, but that would only work for the Documents folder. I would also need it to read sub-folders. I say this is a start because i could then use
    Please Login or Register  to view this content.
    to combine it

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Convert part of string to Hyperlink Text

    Try this code...Once again assuming Path starts in [A1].....Did you see the edit in Post2
    Please Login or Register  to view this content.
    Last edited by sintek; 07-07-2017 at 04:38 PM. Reason: added hyperlink

  5. #5
    Registered User
    Join Date
    12-07-2015
    Location
    Arizona, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Convert part of string to Hyperlink Text

    Edited...
    Sorry you did mention the paths will change...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Assuming the first occurrence is in [A1][/QUOTE]

    Wow! and not even VBA based.

    Now my only Dilema is that i used
    Please Login or Register  to view this content.
    but that doesn't let me delete the original cells

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Convert part of string to Hyperlink Text

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 C:\Users\user\Documents\drawing1.bmp drawing1.bmp
    2 C:\Users\user\Documents\anime.bmp anime.bmp
    3 C:\Users\user\Documents\photo1.bmp photo1.bmp
    4 C:\Users\user\Documents\sketch1.bmp sketch1.bmp
    5 C:\Users\user\Documents\picture1.bmp picture1.bmp
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  7. #7
    Registered User
    Join Date
    12-07-2015
    Location
    Arizona, USA
    MS-Off Ver
    2016
    Posts
    4

    Re: Convert part of string to Hyperlink Text

    Quote Originally Posted by AlKey View Post
    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 C:\Users\user\Documents\drawing1.bmp drawing1.bmp
    2 C:\Users\user\Documents\anime.bmp anime.bmp
    3 C:\Users\user\Documents\photo1.bmp photo1.bmp
    4 C:\Users\user\Documents\sketch1.bmp sketch1.bmp
    5 C:\Users\user\Documents\picture1.bmp picture1.bmp
    This definitely works!! I'll tweak it to fit my needs, as this too can't be used without the original source. maybe i can just shift the original source out of sight and place this in view.

    Edited:
    "out of site" changed to "out of sight"
    Last edited by RubberDinero; 07-07-2017 at 05:13 PM.

+ 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. Replies: 2
    Last Post: 03-18-2015, 07:30 PM
  2. Macro to convert string to hyperlink
    By Groovicles in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-11-2014, 10:33 AM
  3. Need help with with hyperlink part of the text only
    By venkatpvc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-05-2014, 10:08 AM
  4. [SOLVED] Delete a row if a cell contains certain text as part of a text string
    By Steve2107 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2014, 07:49 PM
  5. [SOLVED] Can I remove the first part of a string of text and keep the second part?
    By Whoop92 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 02-12-2014, 07:44 PM
  6. Match text in A1 to a part of a text string in B1 and enter data D1
    By markDuffy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 10:16 PM
  7. [SOLVED] convert hyperlink to string or html
    By scrabtree23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 08:24 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