Couple of things right off the bat...

There's no need for GOTOs in a Select/Case statement - that's the point of the select - only ONE will be done.

The whole Select/Case/Endselect can be replaced with the single line:
 Code:
$Month = IIf(@MONTHNO = 1, 12, @MONTHNO - 1)

This returns 1 if @MONTHNO is 12, otherwise returns one less than @MONTHNO.

Get rid of the If Exist() goto.. there's no fatal error and little penalty if you create a directory that's already there. It's probably more effort to detect it and go around than to just create the folders each time.

You can't output .CSV in multiple Excel sheets (tabs) - by definition, a CSV file is a single array of row/column data in a comma-delimited format. There's no way to specify a "Z-axis", which would represent multiple sheets.

If the "xlLib.udf" being referenced is the one I wrote, you can use that to directly create a .XLS file with as many tabs as you like. Download the latest revision from my web site (resources/Kix functions). You'll want to review the xlSheetAdd() and xlSheetSelect() functions in particular. The xlRangeValue will read/write a range of data on the active sheet.

The logic you should consider is:
1. generate the CSV files as you do now.
2. Use the xlLib functions to open a workbook
3. Use the xlLib functions to create a new sheet - then select the new sheet.
4. Read the file - use my CSV() function to convert each line you read to an array.
5. Use the xlRangeValue to write the array to a row indexed by a pointer var. Increment the pointer after each line read. Repeat the ReadLine / xlRangeValue process until the end of file is reached.

Close your file, point to the next file, and repeat steps 3-5 for each file you created with the adfind command.

That's the basics - there are several things that you can do to streamline this code, but let's get a basic process functioning first.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D