+ Reply to Thread
Results 1 to 4 of 4

How to get multiple file name in excel one cell separated by comma

  1. #1
    Registered User
    Join Date
    05-29-2018
    Location
    India
    MS-Off Ver
    2007
    Posts
    7

    How to get multiple file name in excel one cell separated by comma

    Hi all

    Please help i need to get multiple file names from folder in one excel cell i got the file names in rows using Kutool import file names but i need in one cell separated by coma

    Can any one help me i need vb code for that

    PFA

    Thanks
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor ranman256's Avatar
    Join Date
    07-29-2012
    Location
    Kentucky
    MS-Off Ver
    Excel 2003
    Posts
    1,176

    Re: How to get multiple file name in excel one cell separated by coma

    the folder name is in A1
    the result is in A2
    alter to your descretion
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-29-2018
    Location
    India
    MS-Off Ver
    2007
    Posts
    7

    Re: How to get multiple file name in excel one cell separated by comma

    Thanks that's works but i have to change the column A1 and column A2 every time in code can you do something about it

    A1 B1
    Folder path result
    D:\All Files\iphone 7\136\colour Swho1.jpg
    D:\All Files\iphone 7\137\colour
    D:\All Files\iphone 7\138\colour


    '-------------
    Public Sub ScanAllFilesInFolder()
    '-------------

    'folder name is in A1
    Range("A1").Select
    'files in folder in A2
    Range("B1").Value = getAllFiles1Dir1Cell(ActiveCell.Value)

    End Sub

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: How to get multiple file name in excel one cell separated by comma

    Please Login or Register  to view this content.
    Put the function in a standard module.
    Put all you're foldernames in column A.
    in toprow of column b next to first foldername type
    Please Login or Register  to view this content.
    where A2 is referring to name in column A
    and drag down as long as foldernames in Colum A.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. [SOLVED] Source multiple ID's into one cell separated by a comma.
    By Nordin1981 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 02-18-2018, 03:19 PM
  2. Replies: 16
    Last Post: 02-21-2017, 02:10 AM
  3. Problem with using VBA to import comma separated text file to worksheet - Excel 2013
    By tommagpieconsultants in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2015, 04:57 AM
  4. Help with counting multiple items in a cell separated by a comma
    By excelnoobies in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-11-2012, 02:43 AM
  5. Save excel data range in comma separated .txt file
    By skycowboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2011, 06:38 AM
  6. Replies: 4
    Last Post: 09-04-2010, 03:37 AM
  7. [SOLVED] How do I convert an excel file into a comma separated values file
    By Conquerer in forum Excel General
    Replies: 3
    Last Post: 08-17-2006, 04:25 PM

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