Thread Subject: write2excel

Subject: write2excel

From: Teodor

Date: 29 Oct, 2009 14:57:01

Message: 1 of 7

Hello,
I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
Can enyone help me with this problem?

Subject: write2excel

From: plim

Date: 29 Oct, 2009 16:05:57

Message: 2 of 7

Hi,

this is not the best solution: you can read the data from excel to
matlab, append the new data, and write it again to excel...


On Oct 29, 2:57 pm, "Teodor " <teodoralexan...@yahoo.com> wrote:
> Hello,
> I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> Can enyone help me with this problem?

Subject: write2excel

From: Teodor

Date: 29 Oct, 2009 16:12:03

Message: 3 of 7

plim <manuela.cotrim@gmail.com> wrote in message <23101253-c706-4073-be1c-af1693f8a0fc@r5g2000yqb.googlegroups.com>...
> Hi,
>
> this is not the best solution: you can read the data from excel to
> matlab, append the new data, and write it again to excel...
>
>
> On Oct 29, 2:57?pm, "Teodor " <teodoralexan...@yahoo.com> wrote:
> > Hello,
> > I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> > Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> > Can enyone help me with this problem?

Hmmm...I am new in matlab....can you explain me how to do this?
Thanks in advance!

Subject: write2excel

From: plim

Date: 29 Oct, 2009 16:24:49

Message: 4 of 7

Hi again,

as I mention before this is not the best solution for sure, but until
you find other you can use this one:

- read the data that is already in your excel file to a matrix, using
xlsread.
- Append the new data (from textbox) in this matrix, in a new row
- write the new matrix in the excel file (xlswrite)

See help for xlsread and xlswrite, you have there some examples.

Plim


On Oct 29, 4:12 pm, "Teodor " <teodoralexan...@yahoo.com> wrote:
> plim <manuela.cot...@gmail.com> wrote in message <23101253-c706-4073-be1c-af1693f8a...@r5g2000yqb.googlegroups.com>...



> > Hi,
>
> > this is not the best solution: you can read the data from excel to
> > matlab, append the new data, and write it again to excel...
>
> > On Oct 29, 2:57?pm, "Teodor " <teodoralexan...@yahoo.com> wrote:
> > > Hello,
> > > I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> > > Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> > > Can enyone help me with this problem?
>
> Hmmm...I am new in matlab....can you explain me how to do this?
> Thanks in advance!

Subject: write2excel

From: NZTideMan

Date: 29 Oct, 2009 19:04:54

Message: 5 of 7

On Oct 30, 3:57 am, "Teodor " <teodoralexan...@yahoo.com> wrote:
> Hello,
> I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> Can enyone help me with this problem?

The way I'd do it is to use the facility in xlswrite to name the cell
you want to place the data in. If you want the data to go into column
A, you would define an index indx=0, then do this:
indx=indx+1;
xlswrite(xlsfile,data,sheet,['A' num2str(indx)])

Subject: write2excel

From: plim

Date: 30 Oct, 2009 15:32:35

Message: 6 of 7


Hi NZTideMan,

Do you know a way to get indx automatically from the excel file?

thanks
Plim




On Oct 29, 7:04 pm, NZTideMan <mul...@gmail.com> wrote:
> On Oct 30, 3:57 am, "Teodor " <teodoralexan...@yahoo.com> wrote:
>
> > Hello,
> > I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> > Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> > Can enyone help me with this problem?
>
> The way I'd do it is to use the facility in xlswrite to name the cell
> you want to place the data in.  If you want the data to go into column
> A, you would define an index indx=0, then do this:
> indx=indx+1;
> xlswrite(xlsfile,data,sheet,['A' num2str(indx)]

Subject: write2excel

From: Teodor

Date: 2 Nov, 2009 13:32:02

Message: 7 of 7

plim <manuela.cotrim@gmail.com> wrote in message <b5ff1455-26b5-4e10-94b5-25b1a8132b82@v25g2000yqk.googlegroups.com>...
>
> Hi NZTideMan,
>
> Do you know a way to get indx automatically from the excel file?
>
> thanks
> Plim
>
>
>
>
> On Oct 29, 7:04?pm, NZTideMan <mul...@gmail.com> wrote:
> > On Oct 30, 3:57?am, "Teodor " <teodoralexan...@yahoo.com> wrote:
> >
> > > Hello,
> > > I have a textbox and a button. When I write a number into the textbox and push the button, I want to save that value into an excel file.
> > > Till this point it is simple, but when I want to write a new value into that box and push again the button to save the new value into the excel file, this new value it will overwrite the old one. I want to put the new value in the next row, below the old value in the excel file.
> > > Can enyone help me with this problem?
> >
> > The way I'd do it is to use the facility in xlswrite to name the cell
> > you want to place the data in. ?If you want the data to go into column
> > A, you would define an index indx=0, then do this:
> > indx=indx+1;
> > xlswrite(xlsfile,data,sheet,['A' num2str(indx)]

What I want is whenever I put the new value into the excel, I wold have to read before the excel file and get the index of the first unwritten row and write there the new value.
Do you know how to do this?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com