Re: Exporting TableHeadings to Excel
- To: mathgroup at smc.vnet.net
- Subject: [mg77016] Re: Exporting TableHeadings to Excel
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Thu, 31 May 2007 03:40:15 -0400 (EDT)
On 5/30/07 at 5:24 AM, deanwilliams at mac.com (Dean Williams) wrote:
>Using the example below, I am trying to export the TableHeadings to
>accompany the data into Excel.
>However, when I open Excel, the TableHeadings are lost.
>Is there a way to export the TableHeadings and data together?
Yes, see below
>data = {{"Item1", 1, 2}, {"Item2", 3, 4}}
>aa = TableForm[data,
>TableHeadings -> {None, {"Item", "Heading1", "Heading2"}}]
>Export["testxls.xls", aa]
Instead of using TableForm try the following;
header={"Item", "Heading1", "Heading2"};
Export["testxls.xls", Join[{header},data]]
--
To reply via email subtract one hundred and four