+ Reply to Thread
Results 1 to 9 of 9

Add filename and some values from the files in 1 overview

  1. #1
    Registered User
    Join Date
    03-08-2017
    Location
    Nederland
    MS-Off Ver
    2016
    Posts
    7

    Question Add filename and some values from the files in 1 overview

    hello i have many .xlsx files with many information now i want a list with some information of all these files

    ----------------------------------
    for example:

    Colum A - all the .xlsx File names
    Colum B - the amount of records from Tab(1) (calculate from Colum D)
    Colum C - the amount of records from Tab(2) (calculate from Colum D)

    ---------------------------------

    i got this from a friend it works but its not scanning subfolders and only file names
    Please Login or Register  to view this content.
    is there a solotion to add subfolders to the search and adding the other options a added up here

    can someone help me maybe ?

    Screenshot_4.png
    Last edited by evinx; 03-08-2017 at 01:46 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    Earth
    MS-Off Ver
    2016
    Posts
    692

    Re: Add filename and some values from the files in 1 overview

    Put the code below in the sheet object that you want the results written to, then run it. It will ask you to select a file in the root directory - you can replace this with setting the root directory manually as you have in your code; it will then run through the root directory and all sub-directories, extract the path name, file name, file size, and count the number of non-blank cells in column D of the first and second worksheets.

    Hope that helps.
    Please Login or Register  to view this content.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top left of thread.

  3. #3
    Registered User
    Join Date
    03-08-2017
    Location
    Nederland
    MS-Off Ver
    2016
    Posts
    7

    Re: Add filename and some values from the files in 1 overview

    thanks for your code

    when i copy it and run it i got a error
    Screenshot_1.png

  4. #4
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    Earth
    MS-Off Ver
    2016
    Posts
    692

    Re: Add filename and some values from the files in 1 overview

    I suspect you have put the code in a module or the workbook object. It needs to go in the sheet object that you're writing the results to. Or you can explicitly reference the results sheet if you want to.

  5. #5
    Registered User
    Join Date
    03-08-2017
    Location
    Nederland
    MS-Off Ver
    2016
    Posts
    7

    Re: Add filename and some values from the files in 1 overview

    sorry my fault

    small thing after finish the scan i got a blanke page

    Screenshot_1.png

  6. #6
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    Earth
    MS-Off Ver
    2016
    Posts
    692

    Re: Add filename and some values from the files in 1 overview

    I'm not getting that issue ... perhaps you had a file open in a separate instance of Excel? Does it happen when the workbook with the code is the only Excel file open?

  7. #7
    Registered User
    Join Date
    03-08-2017
    Location
    Nederland
    MS-Off Ver
    2016
    Posts
    7

    Re: Add filename and some values from the files in 1 overview

    yeah nothing else is open everything is closed

    thats the only file open

    it looks like it closes the file after the scan en excel stays open the file window disappear

  8. #8
    Registered User
    Join Date
    03-08-2017
    Location
    Nederland
    MS-Off Ver
    2016
    Posts
    7

    Re: Add filename and some values from the files in 1 overview

    maybe you can see my file whats wrong
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    Earth
    MS-Off Ver
    2016
    Posts
    692

    Re: Add filename and some values from the files in 1 overview

    Nope. I'm not getting that behaviour and all windows are closing correctly.

    You could do something to check for open instances of Excel in other windows but to be honest it's a bit of a pain. Activewindow isn't advisable because if the issue goes away (or isn't there as in my case) then you risk closing the instance with your code (without saving) ... I'm sorry I can't replicate the issue ...
    Last edited by MatrixMan; 03-15-2017 at 12:43 PM.

+ 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. Merge specific files from folder - filename taken from cell values
    By dancing-shadow in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2016, 09:16 PM
  2. [SOLVED] Macro to copy data from multiple sheets to overview and align results on overview sheet
    By McBree in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2015, 04:01 PM
  3. [SOLVED] Loop through files and use the filename without extension
    By desolatori in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2014, 06:05 AM
  4. [SOLVED] Do files with Macros have to keep the same filename?
    By johnandrews in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-16-2014, 06:46 AM
  5. Resoruce overview - Create new sheet and add to sumif function in exsisting overview
    By Martinbif in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-27-2013, 09:58 AM
  6. [SOLVED] Copying files based on filename
    By audioboxer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-01-2012, 01:27 PM
  7. Files won't open when dbl click on filename
    By Global MHP in forum Excel General
    Replies: 3
    Last Post: 11-25-2005, 01:30 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