Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Export Mathematica->Excel [specific sheet]

104 views
Skip to first unread message

sos...@gmail.com

unread,
Apr 30, 2009, 6:18:22 AM4/30/09
to
Hi,
Does anybody know how to set the location for the data when exporting
(for example) a 2x2 data matrix from Mathematica to Excel? - say I
want the matrix to cover cells B2:C3 in "Sheet2"...
I've been looking around on the internet for a solution, but I can't
seem to find anything.

Scot T. Martin

unread,
May 1, 2009, 5:25:09 AM5/1/09
to
As far as I know, this kind of specific flexibility does not exist.
Instead, you have to embed your entries within a list:

data={{},{{},{B2,C2},{B3,C3}}}

This list should save as two sheets, with the entries you want in the
second sheet.

Hans Michel

unread,
May 1, 2009, 5:52:45 AM5/1/09
to

Export to an Excel Format if I recall over writes the previous file.

But if you want to export to a specific location as in your request B2:C3
whatever their RC equivalent is

Try the following
n = Table[i - j, {i, 2}, {j, 2}]
Export["c:\\tfile.xls",
ArrayPad[SparseArray[Transpose[n], Dimensions[Transpose[n]], ""], {1, 2},
""]]

Look at using PadLeft also

This will place 2x2 matrix in position you asked as far as sheet name since
the file name is going to be over written no sense naming it.

If you wish to edit or append to a preexisting excel file then you will have
to treat that excel file like a database an connect to it. And select or
update the row,column in question.

Hans

<sos...@gmail.com> wrote in message news:gtbtte$278$1...@smc.vnet.net...

0 new messages