Hello,

I am creating a series of tabulation summaries using code similar to the code below:
Code:
tab groupvar1 groupvar2, sum(var1) means 
tab groupvar1 groupvar2, sum(var2) means
tab groupvar1 groupvar2, sum(var3) means
tab groupvar1 groupvar2, sum(var4) means
tab groupvar1 groupvar2, sum(var5) means
What I'd ideally like to do is export each of these summary tables into separate sheets of an excel document. I'm not experienced enough with looping or exporting tables/matrices to excel to come up with this coding in a reasonable amount of time. Assistance with this would be much appreciated! Sidenote: I'm sure there might be other ways to get similar information, but I specifically need to have the total means that "tab, sum()" provides in addition to the means by groupvar1 and groupvar2.

--

Alternatively, I'd even appreciate assistance with just exporting one of the table outputs to excel. I'd prefer to not manually repeat these steps for each variable I'm summarizing, but I'll take what I can get.

Thanks!