+ Reply to Thread
Results 1 to 5 of 5

FileNames in folder to Cells with Macro

  1. #1
    Registered User
    Join Date
    09-15-2020
    Location
    Lithuania
    MS-Off Ver
    2019
    Posts
    84

    Question FileNames in folder to Cells with Macro

    I wonder if there is a macro, which can search and fill in collums by file extention in a selected folder and subfolders of the selected folder?
    In this case, it lists all Solidworks Filenames in 1st collumn, and in 2nd and 3rd collumn it fills .pdf and .dxf extention names of files that have at least part of FileName in their names?

    Screenshot_1.jpg

    Screenshot_2.jpg
    Last edited by windzz; 12-31-2020 at 06:20 AM.

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Macro to fill the same FileNames into cullumns with other extentions

    more than likely, the answer here will be all you need:

    https://www.excelforum.com/excel-pro...-a-column.html

  3. #3
    Registered User
    Join Date
    09-15-2020
    Location
    Lithuania
    MS-Off Ver
    2019
    Posts
    84

    Re: Macro to fill the same FileNames into cullumns with other extentions

    So I managed to edit your code and get the names from the folder!
    The problem is , I don't know how to paste these FileNames to Worksheet cells.

    Like fill all filename into Worksheet MAIN Range("A1").
    Maybe you have an idea?

    Please Login or Register  to view this content.
    Untitled.jpg
    Last edited by windzz; 12-31-2020 at 06:18 AM.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: FileNames in folder to Cells with Macro

    Like fill all filename into Worksheet MAIN Range("A1").
    LOL. hey! pretty close! try this instead?
    Please Login or Register  to view this content.
    rules for that code to work:
    • code must be behind the sheet you want the file name to go in, OR:
    • code in a standard module and the active sheet be the target sheet to get the data
    • all filenames are thrown into column A only
    • first filename thrown to row 2, and every other filename thrown down each row, one by one downward, until no more files found
    • you want file names to start being thrown into cell ''A2''

    this will obviously have to be changed when you run it. but I'm sure you can change it to get what you want, if you could take my original and get as far as you did.
    Last edited by vba_php; 12-31-2020 at 09:11 AM.

  5. #5
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: FileNames in folder to Cells with Macro

    and by the way, if you want to learn something else, you actually touched a very common subject in the programming world with your attempt as pseudo code:

    this:
    Please Login or Register  to view this content.
    is hugely popular is sophisticated languages. along with what is known as a VOID. way beyond VBA. that word actually plays a key role in programs booting up in C#, Java, and a few other languages. so there ya go, something to think about when you become a genius and take your boss's job away.
    Last edited by vba_php; 12-31-2020 at 09:12 AM.

+ 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] Macro to retrieve filenames
    By TimmerSuds in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-18-2020, 05:51 AM
  2. [SOLVED] Changing extentions names of files in folder that never had an ext in the first place?
    By 0o0o0 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-09-2018, 01:35 PM
  3. How to ensure that both .xls and .xlsx extentions respond to a command
    By vivekchha in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-03-2014, 03:08 PM
  4. Pass Filenames into Macro
    By CodyKL in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2012, 11:38 AM
  5. Dynamic Filenames using the macro
    By lev_lev in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 05:23 PM
  6. deleting files by extentions
    By sshehab in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2010, 02:03 PM
  7. Replies: 9
    Last Post: 02-14-2009, 01:50 PM

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