Relative Directory Reference

  • I can’t seem to remember a simple relative directory reference.

    This is what I’m trying to do… I have a cell where I used to hard code a directory path to a network directory. (i.e. H:\HMS\Master Files) Then in various Sub Routines I would reference that cell for the path.

    What I’d like to do is put in that cell a relative reference to the same directory that the activeworkbook is located. I used this before but I can’t seem to remember or find an example of it. It was pretty elegant one could even use a similar method to look one directory up. I think it looked something like “\\”.

    Any idea’s, it harkens back to old DOS/Basic programming but I believe it still works. I didn’t want to use VBA code i.e. “Thisworkbook.path” for I’d have to change it in so many places. I’d rather figure out the above.



  • Re: Relative Directory Reference

    wouldn't know the function you are mentioning but how about a user defined function useing .path .

    In formulae, depending on your locale, you might have to replace ; with , or vice versa.

  • Re: Relative Directory Reference

    I could but would rather figure the before mentioned method. In the end it's simple but effective.

    Thanks for trying anyway.


Participate now!

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