+ Reply to Thread
Results 1 to 3 of 3

Get directory from cell

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    Vancouver
    MS-Off Ver
    Excel 2010
    Posts
    25

    Get directory from cell

    In my worksheet I have referenced a directory location. Eg: Cell A1 is C:\Users\NAME\Desktop\

    How do I use this in a VBA by referencing the cell rather than hard coding the directory?

    So for example: instead of the VBA reading:

    ChDir "C:\Users\NAME\Desktop\"
    It would read

    ChDir "A1"

    Thanks

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Get directory from cell

    a couple of ways could work - HTH

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    Vancouver
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Get directory from cell

    Thanks for the reply. I put this code in but it's coming up with an error. Do I simply replace "Sheet1" with my worksheet name and replace .cells(1,1) with the correct cell? Eg: .cells("D10)?

+ 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