Open folder named after cell value

  • Hello all,

    I'm pretty new at VBA so I could use some help with this.

    I have a costumer name in cell A1 and I have a folder with different folders named after costumers (let's say folders named Batman,Superman,Spiderman,etc)

    I want to press a button, which looks in this main folder after the name in cell A1 and open it. If it's not found I want a messagebox saying the folder was not found.

    Long story short I want to put "Batman" in cell A1, press a button which looks for a folder named "Batman" in a specific location (D:\Export\Costumers) and opens it when found. If not found get an error message in a messagebox.

    If anyone could help me out with this would be greatly appreciated.

    Thanks in advance.

  • Try this, you can create the folder if required

  • Try this, you can create the folder if required

    thank you that work great for checking if the folder exists or not. However I would like to have it open said folder once it's found it. I've been trying to get that to work but its hard for me.

    What do I add to the code to have it open the folder once it's found it?

    Thanks again for your help!

  • Try this

  • Got it to work after editing your code a little, thank you so much!

    Ended up with this: