+ Reply to Thread
Results 1 to 5 of 5

Macro to Open Folder

Hybrid View

  1. #1
    Registered User
    Join Date
    02-18-2004
    Posts
    55

    Macro to Open Folder

    I'm trying to create a macro that opens a folder based on a cell Value...

    Example: I have a drop down list with three choices. a,b,c.

    Under that I have a Button that I want to program a macro to open a different folder depending on which choice is made.

    I assume something like that is possible, but I'm to new to VBA to know how to go about doing it. Any ideas would are greatly apprecitiated. Thanks in advance.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,295

    Re: Macro to Open Folder

    Hi pjw23.

    We all learned to write code by turning on the "Record Macro" feature and doing something simple. They you turn it off and look at the code the Macro wrote. This is your first step in learning to code.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-18-2004
    Posts
    55

    Re: Macro to Open Folder

    Marvin I appreciate you stating the obvious, however, the whole problem is that I don't know how to incorporate the macro based on a drop down selection. It's pretty easy to record a macro to open a file, however, I want to open a FOLDER in explorer....Also, I want to open a specific folder based on a cells value....If you can tell me how to record that, I'm all ears...

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Macro to Open Folder

    Why open it in Explorer? What are you going to do after it's open?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,295

    Re: Macro to Open Folder

    Hi shg, Thanks for jumping in.

    I've just spent the last hour working through the VBA Object Browser (I hate that thing) looking for a way to set the default path before I call
    Application.FindFile
    which is my favorite for helping users pick files to open. I thought this would solve this OPs problem.

    I've failed to find how FindFile sets where it has last been. Do you have a good answer for this in looking for setting this OPs default path? If I could find the Object I could set the default path to his dropdown and then FindFile so he could click on the correct file. I thought that was his question.

    Now that I reread his answer and your post, I realize he does want Explorer. Why not just set up a Hyperlink or do a Shell command?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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