LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Using Dir function to find folders

I found a way to do it without MacID. Here's what worked for me:

On Error Resume Next
subDir(1) = Dir(pathTbox, vbDirectory)
On Error GoTo 0
If subDir(1) = "" Then
MsgBox "No sub directories were found in " & pathTbox
Exit Sub
End If
j = 1
While subDir(j) < ""
On Error Resume Next
j = j + 1
subDir(j) = Dir()
On Error GoTo 0
Wend
j = j - 1
msg = ""
For i = 1 To j
msg = msg & subDir(i) & vbCr
Next i
MsgBox "The " & j & " sub directories found were " & msg
Stop


"T_o_n_y" wrote:

Can someone provide me with a working code snippet to find all folders in a
directory on a Mac? I'm running Excel 2004 on a mac, and know that I need to
use something like

FolderName = Dir(Input_Dir, MacID("TEXT"))

but something other than "TEXT" needs to go there. Can someone tell me what
the resource type is that I need to use to specify a folder?

Actually, I want to find the names of all sub folders within a folder so I
think I need to call it as above and then call

FolderName = Dir("", MacID("TEXT"))

or something like that for subsequent calls.

Thanks!

 
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
List folders but not sub folders kaiser Excel Programming 2 July 19th 07 11:14 AM
Find Folders SteveW Excel Programming 1 November 17th 05 04:34 PM
DIR function and compressed folders Graham Excel Programming 0 October 24th 04 09:59 PM
DIR function and compressed folders Graham Excel Programming 0 October 22nd 04 10:39 AM
Dir() function to return either List of files or folders R Avery Excel Programming 12 July 19th 04 09:29 PM


All times are GMT +1. The time now is 10:00 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"