Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
A1=name of folder B1= Subfolders,seperated by comma(Tricky Problem?) | Excel Programming | |||
List cell values seperated by comma if criteria met | Excel Worksheet Functions | |||
How to split a value seperated by comma? | Excel Discussion (Misc queries) | |||
Reading from comma seperated List | Excel Programming | |||
Problem with comma seperated list | Excel Programming |