Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default List Subfolders Horizontally, seperated by comma, instead ofvertically

I finally managed to do this script almost what i want:
it is listing the subfolders of a folder-name that i put in A1

But instead of having the result in Collumn B BELOW each other, i
would like to have it
next to each other, into 1 cell (in this case, B1), seperated by
comma.

Example: A1="Folder" B1="Subfolder1,Subfolder2,Subfolder3"

Sub tt()
Dim FSO, FO, FU, F
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FO = FSO.GetFolder(ActiveWorkbook.Path & "/" & Range("A1"))
Set FU = FO.SubFolders
For Each F In FU
Range("B65536").End(xlUp).Offset(1, 0).Value = Right(F, Len(F) -
InStrRev(F, "\"))
Next F
End Sub

PS: i dont need to go to a deeper level of subfolders (dont need to
see what folders are in, e.g. subfolder1)
Reply
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
A1=name of folder B1= Subfolders,seperated by comma(Tricky Problem?) Tobi Harnegg Excel Programming 5 February 10th 09 02:11 AM
List cell values seperated by comma if criteria met Mike Pearson[_2_] Excel Worksheet Functions 2 June 2nd 07 10:31 PM
How to split a value seperated by comma? Ticktockman Excel Discussion (Misc queries) 2 March 23rd 06 04:20 PM
Reading from comma seperated List Shashi Bhosale Excel Programming 2 May 29th 05 06:50 PM
Problem with comma seperated list Siw H. Thorslund Excel Programming 10 February 24th 04 11:05 AM


All times are GMT +1. The time now is 07:46 PM.

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

About Us

"It's about Microsoft Excel"