+ Reply to Thread
Results 1 to 2 of 2

Folder Details from Multiple Locations

  1. #1
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Folder Details from Multiple Locations

    Hello All

    I have found a VBA Code that extracts the Folder Names from a location which is given in the code.

    Whereas I need to run this to Multiple locations at once. All location details are placed in my workbook Sheet1 Column A.

    Kindly help me...

    [CODE][/Private Sub PrintFolders()
    Dim objFSO As Object
    Dim objFolder As Object
    Dim objSubFolder As Object
    Dim i As Integer
    Application.StatusBar = ""
    'Create an instance of the FileSystemObject
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    'Get the folder object
    Set objFolder = objFSO.GetFolder("C:\22207")
    i = 1
    'loops through each folder in the directory and prints their names and path
    On Error GoTo handleCancel
    Application.EnableCancelKey = xlErrorHandler
    MsgBox "Process Completed: press ESC to cancel"
    For Each objSubFolder In objFolder.subfolders
    Application.StatusBar = objSubFolder.Path & " " & objSubFolder.Name
    'print folder name
    Cells(i + 1, 1) = objSubFolder.Name
    'print folder path
    Cells(i + 1, 2) = objSubFolder.Path
    i = i + 1
    Next objSubFolder
    handleCancel:
    If Err = 18 Then
    MsgBox "You cancelled"
    End If
    End Sub
    CODE]

  2. #2
    Forum Contributor
    Join Date
    12-20-2012
    Location
    Hyderabad
    MS-Off Ver
    Excel 2007 & Excel 2010
    Posts
    115

    Re: Folder Details from Multiple Locations

    Here is the code..

    Please Login or Register  to view this content.

+ 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. Saving file to folder using cell details
    By deefield in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-30-2016, 05:18 PM
  2. extracting folder & file details in excel
    By Navin Agrawal in forum Excel General
    Replies: 1
    Last Post: 01-16-2015, 11:51 AM
  3. [SOLVED] Size of Folder details
    By mvinay in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2014, 02:29 AM
  4. vba to save pdf in two folder locations
    By rtcwlomax in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-10-2012, 08:10 AM
  5. List of file names & details in a folder
    By Navin Agrawal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-04-2012, 04:02 AM
  6. Find Details of Files in Folder
    By dvent in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-22-2007, 09:04 PM
  7. linking two workbooks in different folder locations
    By Andyd74 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2006, 10:19 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