Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formatting worksheet names in a folder | Excel Discussion (Misc queries) | |||
How do I paste a set of folder NAMES into a set of cells? | Excel Discussion (Misc queries) | |||
How do I paste a set of folder NAMES into a set of cells? | Excel Discussion (Misc queries) | |||
Combine several Names in one folder with if-formula | Excel Discussion (Misc queries) | |||
Change names of files in a folder to match names in Excel Column | Excel Programming |