+ Reply to Thread
Results 1 to 5 of 5

Extract file names from a folder creating hyperlink

  1. #1
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2016
    Posts
    341

    Extract file names from a folder creating hyperlink

    Hi all,

    I have the below code which extracts the file name from a folder. I still need a bit of tweaking so that, extracted name is bit of crisp and hyperlinked.

    Ex: All the files in the folder are pdfs and names are in the fashion "xxxxxx_xxxx-xx.pdf.

    I want to extract only till the "_" (underscore) not the letters after underscore and neither the extension name. I then want to add hyperlink to that name.

    Please help.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Extract file names from a folder creating hyperlink

    check this it should help you

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=232


    or this


    http://software-solutions-online.com...les-excel-vba/
    Last edited by Toonies; 04-30-2016 at 07:14 AM. Reason: additional comment

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Extract file names from a folder creating hyperlink

    This should work

    It takes the pdf files from the nominated directory, truncates based on your criteria to only have left of the "_" and then places it in column B of sheet 1 and hyperlinks them to their respective file.

    You'll need to change the file directory from C:\temp to what ever your location is

    Please Login or Register  to view this content.
    Last edited by Crooza; 04-30-2016 at 09:33 PM. Reason: fixed up some code
    Happy with my advice? Click on the * reputation button below

  4. #4
    Forum Contributor
    Join Date
    09-16-2014
    Location
    Hyderabad
    MS-Off Ver
    MS Office 2016
    Posts
    341

    Re: Extract file names from a folder creating hyperlink

    @crooza..

    Instead of fixed directory, can we use file.dialog, so that it is more user friendly

  5. #5
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Extract file names from a folder creating hyperlink

    OK thry this. I borrowed the bit between the ------- from another source and modified it. It works on my machine

    Please Login or Register  to view this content.

+ 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] Codes to extract file names in folder & renaming sheets
    By Navin Agrawal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2016, 12:12 PM
  2. [SOLVED] Creating multiple hyperlinks to files in a folder - one file per hyperlink per cell
    By fsusd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2014, 12:17 PM
  3. Need VBA Macro to extract folder names and sub folder name
    By Nanimadhu in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2014, 07:16 AM
  4. Loop Through Folder - extract Wb and Sheet Names
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-18-2010, 12:35 AM
  5. Extract file names from folder`
    By Dri in forum Excel General
    Replies: 3
    Last Post: 05-29-2007, 09:16 AM
  6. [SOLVED] Extract file names from folder
    By Haraki in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2006, 05:55 PM
  7. [SOLVED] Extract folder names only
    By Michael Singmin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2006, 08:55 AM

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