LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
GC. GC. is offline
external usenet poster
 
Posts: 1
Default How to Get Folder Names


Dear Helpers,

First of all I would like to thank you so very much for some help tha
I got from this site...

I was searching for keywords "extract file names from folders" and
got many results but went with 'this page' (http://tinyurl.com/4gk7n)
And the modified code post from VIKRAM...just did what I wanted t
do...here'z the CODE:

============================
Sub IndexFiles()
With Application.FileSearch
.LookIn = "C:\MyMusic"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = True
.Execute
End With
cnt = Application.FileSearch.FoundFiles.Count
For i = 1 To cnt
Rng = "A" & i
Range(Rng).Value = Application.FileSearch.FoundFiles.Item(i)
Next i
End Sub
=============================

Now...here'z a little additional stuff that I would like Excel t
perform...

After making this macro as guided by Vikram in the above hyperlink,
am able to get the path to all files...like this:

I:\New Songs\DAP Songs\(AA_AB_LAUT_CHALEN)-MERA_DIL_TERA_DEEWANA.mp3
I:\New Songs\DAP Songs\(DIL_SE)-DILSERE_DILSERE.mp3
I:\New Songs\BEST OF STERIO NATION\01 - ISHQ HOGAYA.mp3
I:\New Songs\NAYEE PADOSAN\01 - SARI SARI RAINA.mp3
I:\New Songs\Aashiqui - Abhijeet\01 - Track 1.rmj

Now what exactly I wanna do is to get the names of the Folders (ONLY
as highlighted in red colour in the above lines) instead o
files...like I want instead of above five lines...

DAP Songs
Best of STERIO NATION
NAYEE PADOSAN
Aashiqui - Abhijeet

NB: As DAP Songs has two files in it, so it appeared twice in the abov
list...but since it is only one directory, I want it in my list onc
only...

Hope to receive help ASAP :) THANK YOU GUYz once again in advance fo
any help.

Kind regards.

GC

--
GC
-----------------------------------------------------------------------
GC.'s Profile: http://www.excelforum.com/member.php...fo&userid=1665
View this thread: http://www.excelforum.com/showthread.php?threadid=31863

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
formatting worksheet names in a folder kaywe44 Excel Discussion (Misc queries) 4 January 17th 08 03:54 PM
How do I paste a set of folder NAMES into a set of cells? No Name Excel Discussion (Misc queries) 0 September 13th 07 08:56 AM
How do I paste a set of folder NAMES into a set of cells? Jedi Leba Excel Discussion (Misc queries) 2 September 13th 07 08:54 AM
Combine several Names in one folder with if-formula Vic1978 Excel Discussion (Misc queries) 4 December 7th 05 12:38 PM
Change names of files in a folder to match names in Excel Column saybut Excel Programming 4 February 9th 04 06:26 PM


All times are GMT +1. The time now is 11:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"