+ Reply to Thread
Results 1 to 3 of 3

Search only for specific word

  1. #1
    Registered User
    Join Date
    11-24-2018
    Location
    Portugal
    MS-Off Ver
    2010
    Posts
    5

    Search only for specific word

    I hope I can explain my doubt.
    I have a directory where it contains several folders but only interest me the folders with the names Notes 2013, Notes 2014 ... Notes 2019
    I have a D3 cell that, when I put it, for example, 2018, it returns all subfolders inside Notes 2018.
    What I intended is when cell D3 is empty, return everything with the name Notes (Notes 2013, Notes 2014 ... Notes 2019) and not the rest of the folders with other names.
    My problem is in the second IF
    Can anyone help?

    My Code:

    Please Login or Register  to view this content.

    Thank's again!
    Last edited by jeffreybrown; 11-24-2018 at 04:38 PM. Reason: Please use code tags!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,659

    Re: Search only for specific word

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    11-24-2018
    Location
    Portugal
    MS-Off Ver
    2010
    Posts
    5

    Re: Search only for specific word

    Thank you for helping me.

    Unfortunately it's still not working

    When the D3 folder is empty, instead of just giving the main folder name (Note 2017, Note 2018, Note 2019 ...) it is returning all the folders inside the main folders ...
    For now, i just want to return the name of the main folders.

    Other small bug's I found

    If, for example, the folder Notes 2017 only has a folder in it, it gives the error "Run-Time error" 9 "- Subscript out of range" on "Resize (UBound (MyArr, 1) UBound (MyArr, 2)) Value = MyArr "
    With to folders inside its ok and dont show the error

    Another bug, if i sabe and re-opened the excel he gives the error here "Set objFolder = objFSO.GetFolder (strMainFldr)"

    Thanks again.

    Sorry jeffreybrown - Forget the code tags!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 01-16-2014, 07:25 PM
  2. [SOLVED] Replace search results with a specific Word
    By zicitron in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-30-2013, 06:25 AM
  3. VBA Macro for search specific word and input specific value
    By Toton6868 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 01-10-2013, 07:14 AM
  4. [SOLVED] Search for specific word and offset and change value.
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-21-2011, 12:59 PM
  5. Excel Macro to Search Row for specific set of word
    By borzoa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2011, 11:40 PM
  6. Replies: 13
    Last Post: 08-04-2011, 09:41 AM
  7. Replies: 1
    Last Post: 01-25-2011, 10:50 PM
  8. search for a specific word and copy the word and the preceeding words until a comma
    By DHANANJAY in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-31-2005, 09:10 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