+ Reply to Thread
Results 1 to 6 of 6

Selective listing of files in a folder

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Selective listing of files in a folder

    The following code lists all files in a selected folder. Is there any way to list only files that contain specific text. In my case I want to only list files with both brackets. From the list below, output is Volume 1 (Section 1) and Volume 3 (S7). Text within brackets maybe of any length.
    I would like to keep code in the same format.

    Volume 1 (Section 1)
    Volume 2 All
    Volume 3 (S7)
    Volume 4, Section 10
    Volume 5 - Section 3


    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Selective listing of files in a folder

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Selective listing of files in a folder

    It seems to work.
    Thanks for the modification.

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Selective listing of files in a folder

    If I replace with square brackets, it does not work. Do you know why?

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Selective listing of files in a folder

    When using the Like operator anything between square brackets is treated as a character list to match a single character.

    For example if you wanted to check for A-Z you would use [A-Z].

    Try this for finding [ followed by ].
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Selective listing of files in a folder

    Thank you again.

+ 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. listing excel files in a folder including subfolders
    By olivermdantes in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 02-22-2016, 04:17 AM
  2. Listing number of files per folder?
    By dark91zc in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-07-2013, 03:20 PM
  3. Replies: 0
    Last Post: 06-17-2013, 05:33 AM
  4. [SOLVED] VBA for listing Products in All Excel Files in Folder
    By e.isayev in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-16-2013, 05:26 PM
  5. Listing/Renaming Files in a folder from excel
    By Kelshaer in forum Excel Tips
    Replies: 4
    Last Post: 01-23-2013, 11:04 AM
  6. Listing files contained in a folder
    By boylejob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2008, 11:13 AM
  7. Periodically listing files in a folder
    By haven104 in forum Excel General
    Replies: 2
    Last Post: 01-10-2006, 05: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