+ Reply to Thread
Results 1 to 6 of 6

Button to open folder based on cell hyperlink adress

  1. #1
    Registered User
    Join Date
    07-24-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    33

    Button to open folder based on cell hyperlink adress

    Hello All,

    I would like to ask you for help. I have in cell F8 this =HYPERLINK(F9) in cell F9 is changing content based on other cells example (C:\Users\xxx\Desktop\AAA\BBB\CCC\) . I need a button that open the hyperlink in cell F8 by clicking on it. I tried few codes that are work for opening files, but they are not working for folders. Could you please help me whit that? Thanks very much.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Button to open folder based on cell hyperlink adress

    Why not just click on the hyperlink cell itself?

    One way that can be done is using Shell to run explorer, but not recommended.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    07-24-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Button to open folder based on cell hyperlink adress

    Well i know its easiest by clicking on the hyperlink, but button looks nicer, so you saying is not worth to make a button?

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Button to open folder based on cell hyperlink adress

    What I am saying is, if you're gonna use VBA to open the folder, both cells F8 and F9 are not necessary, unless you want to display visibly the directory. Then the next thing is, using Shell is the only way I know to open a folder with VBA, but may not be the best solution.

    If you really want to try it:
    Please Login or Register  to view this content.

    Edit:
    I suggest using VBA to create the hyperlink into a cell (i.e. F8), and then follow the link. Use the record macro function, you will get the code readily. Then bind the code (recorded macro) to a button.

  5. #5
    Registered User
    Join Date
    07-24-2013
    Location
    Slovakia
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: Button to open folder based on cell hyperlink adress

    Hello millz,

    thanks for the code its working exactly as i expected, but it is possible after i click the button that the opened folder will be in front and not behind the excel? Thanks

  6. #6
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Button to open folder based on cell hyperlink adress

    Just add the second argument of Shell. You can look up Shell function in the VBA help file.
    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. VBA to open folder on the network based on data from the active cell
    By s0o0y in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-27-2013, 04:38 PM
  2. [SOLVED] Command Button to open folder
    By Will_iam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-25-2013, 06:18 AM
  3. Replies: 1
    Last Post: 01-10-2013, 08:22 AM
  4. Hyperlink to open single-pane folder?
    By terrypin in forum Excel General
    Replies: 2
    Last Post: 01-06-2010, 12:21 PM
  5. Open multiple files from a folder based on cell information?
    By bshape1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-03-2008, 07: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