• This is more than a vague question...

    What do you mean "save by userId"? Just the sort order within a Excel worksheet? An additional line between each userId to separate it visually?

    Separate Worksheets? Separate Excel files?

    What do you mean by "email the file too"? Do you want to mail the final Excel file just created or the output of the query as csv or xls file?

    In all cases the short answer is "Yes, it can be done". But the effort may vary...

    If you need a moer detailed answer, please provide a more detailed question together with ready to use sample data and expected result(s). See the first link in my signatur on how to do that to make it easy for us to help you.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]