+ Reply to Thread
Results 1 to 8 of 8

Find folder path with partial information

  1. #1
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    Find folder path with partial information

    Hi folks

    I come to you needing help - again!!

    I have the following code below...

    Please Login or Register  to view this content.
    I am trying to find a folder path (in order to save the file into the folder) however the folders START with a project number, i.e. 14070 and then have some text after it.

    I'm hoping there is a way of searching for the folder path using the project number which will always be at the start of the folderpath.

    the above code works bu only when I put the actual number into the projst and sProjn quotations, but obviously these will always be variable from time to time.

    can you help?!?!?

    TVM

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Find folder path with partial information

    You mean you want it like this? Then you can use call find_Folder("D3","D4")

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Find folder path with partial information

    Hi thanks but...

    I still get a Constant Expression required error on the 'projst' part of the code???

    any ideas?

    TVM

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Find folder path with partial information

    Sorry, I missed that const part, you need this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Find folder path with partial information

    Hi

    Its now coming up with No Match Found, even though I know for sure that there is a folder starting with the project number i am using....

    ??

  6. #6
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Find folder path with partial information

    I haven't changed anything about the code, just re-organised it so you can pass variables into it. You mention it worked before so it should still work as it did. If you use the projst and sprojn values that you are testing it in the first code you posted does it work?

    I've also double checked and tested it with some examples on my machine and it worked ok. The only thing I can think of is are you sure you want a space between AS and projst? Maybe try this:
    Please Login or Register  to view this content.
    and double check it is looking for the right folder.

  7. #7
    Registered User
    Join Date
    10-10-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    75

    Re: Find folder path with partial information

    MY BAD!!!!

    Sorry - I was putting the wrong information down in the Call procedure for the Sub - hence why it wasnt finding anything!!!

    Seems to be working fine now, so thanks very much for your help!!

    TVM

  8. #8
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Find folder path with partial information

    Actually, thank you, I had a bit of code that did the exact same thing but this method is much quicker!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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