+ Reply to Thread
Results 1 to 8 of 8

Adding FileSystem Object to my current macro

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Adding FileSystem Object to my current macro

    I was getting help from Jakobshavn (Thanks Again) on working on the code on this link Orginal Thread

    here is the code

    Please Login or Register  to view this content.
    How can I get this to read every folder from a main folder and list the number of contents in the sub folder?
    Example X:\YYZ = Main Folder
    1 = sub folder
    12 files
    2 = sub folder
    1 file
    3 = sub folder
    101 files

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Adding FileSystem Object to my current macro

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Adding FileSystem Object to my current macro

    I have tried what you put and it does not work with any of my code. I also have run time enabled. From this point I am lost.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Adding FileSystem Object to my current macro

    If I run Macro1 in this code:
    Please Login or Register  to view this content.
    I get the contents of E:\Data subfolders and number of files as a message box. If I run macro1 in this code, the data is assigned to cell A1 of the activesheet.
    Please Login or Register  to view this content.
    Does this work for you if you assign a valid path, if so - what do you then want to do with the information?

  5. #5
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Adding FileSystem Object to my current macro

    Ok this is getting better but what i need this code to do is open the get folder window so i can select the folder that contains all of the patient folders then list the name of the patient in one cell and then the contents of that patients folder in the next cell. Right now it puts everything into one cell and you cant really read it.

    I have been working on similar code that is a little different. I will post it in a few. Ultimately in the end I want this to be put into the current code I have so my boss has the break down of every patient and number of x rays in each folder.

  6. #6
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Adding FileSystem Object to my current macro

    This is the code I have.
    What it does is it imports the name of every folder then splits it by Last name, First name, Record number,and Date of Birth. It also sorts the record number in Terminal Digit so it reads the last 2 number first then the middle 2 numbers then the last 4 numbers and puts them in order from there.

    With this new code i want to be able to add a X-ray count Column so it lists the files per folder also right after the Date of Birth.

    Hope this helps some.



    Please Login or Register  to view this content.
    Last edited by dark91zc; 11-08-2013 at 12:11 PM.

  7. #7
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Adding FileSystem Object to my current macro

    You just need to be a little more specific, I just gave you a general function as I didn't know what you wanted to do with the data... This will list in columns A and B, starting in the last blank cell in column A
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-18-2013
    Location
    hacienda heights, ca
    MS-Off Ver
    Excel 2007 / Excel 2010
    Posts
    43

    Re: Adding FileSystem Object to my current macro

    Awesome!!! Thank you so much Rep Added!!!! Now i just need to figure out how to add it to my current code. 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. Help With Current Macro Adding Copy Over
    By gaspower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-21-2013, 07:09 PM
  2. [SOLVED] Generic Current Object Reference Inside that Object's Code
    By Aegwyn11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2012, 01:23 PM
  3. adding current date then after saving the file current date function stops
    By gotbitey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-21-2011, 02:15 PM
  4. Adding action to current macro
    By houseguy007 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-19-2010, 02:53 PM
  5. [SOLVED] current date and time object
    By Randy Starkey in forum Excel General
    Replies: 14
    Last Post: 11-05-2005, 03:55 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