Closed Thread
Results 1 to 5 of 5

Find Folder Name VBA Code

  1. #1
    Registered User
    Join Date
    07-17-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    8

    Find Folder Name VBA Code

    I have tried several codes to get this to work with no success.
    I have a folder that has subfolders (A-Z) that will mostly be formatted as "Name - P1111####" however sometimes it will just be "P1111####" ####= random numbers

    I need a code that will use the value from a textbox in the userform (in this case "P1111####") search all the subfolders in the main directory and come back and tell me if a folder containing that text was found. Regardless if the name is there or not. *Bonus points for opening the containing folder "Not the file(s)*

    If it's not found then advise that well.

    Basically, the same way windows search does it when you type info into the search bar it just locates a folder containing that text regardless of extra text.

    The folders have been Separated A-Z based on the first letter in the "Name" but really I don't care about searching the "Name" it's mostly there to help verify that the number matches the correct account.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Find Folder Name VBA Code

    crossposted: https://www.mrexcel.com/board/thread...-code.1193436/

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    07-17-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Find Folder Name VBA Code

    To be honest, I had no idea... I was under the impression these 2 sites were completely separate. I am sorry.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Find Folder Name VBA Code

    The sites are not related. Did you read the link I provided as to why we ask you to provide the crosspost. Did you read our forum rules?

  5. #5
    Registered User
    Join Date
    07-17-2020
    Location
    USA
    MS-Off Ver
    2016
    Posts
    8

    Re: Find Folder Name VBA Code

    No, and no I just follow common sense, and linking to where I also posted did not appear as common sense, but in future I will link cross posts. You can delete/close this thread anyways reddit provided help, and I'll probably stick with them from now on.

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel VBA code for selecting a folder then search & open specified files in that folder
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-27-2021, 03:09 AM
  2. How to find a file name in Old Folder then save in New Folder if found
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2018, 11:25 AM
  3. [SOLVED] VBA Code to save to a folder within a folder within a folder all based on cell values.
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2016, 04:24 PM
  4. Replies: 2
    Last Post: 12-29-2015, 04:19 AM
  5. [SOLVED] Help with Macro to find full path of Folder, using input of first 4 chars of folder name
    By Anxiety in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2015, 09:02 AM
  6. [SOLVED] VBA Code to find a Folder name within a Parent folder that contains defined text
    By knowga in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-24-2014, 05:17 AM
  7. Macro code should find inv no in folder and send attachhed mail.
    By visha_1984 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-30-2013, 07:55 AM

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