Dir for Excel 2011 for the Mac

By in VBA on .

Hi all

Like a lot of other things in VBA in Office 2011 Dir is not working the same as in Windows.

Together with a great Apple Scripter DJ Bazzie Wazzie I create a VBA function that you can use instead. You can download a file from my site so you can test it.

http://www.rondebruin.nl/mac.htm#Loop

You call the function with one line of code :

Call GetFilesOnMacWithOrWithoutSubfolders(Level:=1, ExtChoice:=0, FileFilterOption:=0, FileNameFilterStr:=”SearchString”)

‘Level : 1= Only the files in the folder, 2 to ? levels of subfolders

‘ExtChoice : 0=(xls|xlsx|xlsm|xlsb), 1=xls , 2=xlsx, 3=xlsm, 4=xlsb, 5=csv, 6=txt, 7=all files, 8=(xlsx|xlsm|xlsb), 9=(csv|txt)

‘FileFilterOption : 0=No Filter, 1=Begins, 2=Ends, 3=Contains

‘FileNameFilterStr : Search string used when FileFilterOption = 1, 2 or 3

 

You can add also more extensions or replace it for word extensions or so.

Thanks, feedback good or bad is welcome

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax