Use variable cell value as folder path in vba

  • Hi All,

    I have multiple users that will access a workbook and run a macro to combine a number of sheet in a single worksheet. Therefore I need to allow each user to browse their own folder where to the relevant sheets are stored. I have the following piece of code that allows a user to browse their folder.

    The result is then stored in sheet "A" cell "B11" which I then want to use in the vba code (only portion of the full code) below as folder path. As mentioned before, this path will change for each user and cannot be static:

    Any suggestion or assistance will be greatly appreciated. Please let me know if you need any further information.

    Thank you in advance.

    Kind Regards


  • This is the best way to clear data from a Table

     ''///Delete table data and keep formulas
        If Not oTbl.DataBodyRange Is Nothing Then    oTbl.DataBodyRange.Delete

    I can't see where in your code you are storing the path. Why do you not let the user use the file browser to determine the path as part of the main macro?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!