Prev: Sendmail Error
Next: Fminsearch X0 interval
From: ade77 on 14 Apr 2010 17:49 > Thanks ade77. > > I was hoping for a simple solution in the xlswrite-line, although this is an interesting option. However, it might be easier to just split up the cell array into several parts (not just two, since there are more rows which are merged) that correspond with cells being merged or not and write all these parts separately to Excel. > > I'll think about what I'm going to do, if in the meantime you or anyone else thinks of a quicker solution please let me know. Freek, your option will work, but you will have to manually format it in excel. For example, if the excel file given to you already contain the merged cells, you will not be able to center the value to appear in E1. Also, if the excel file given to you does not contain the merged cells, after you write the data into excel, you will have to manually format it to be merged. Of course, if you have just 7, or 10 excel files, you can manually do it, but if you have like 500 excel files, or you want to be able to automate it on a regular basis, then activex is a better option. In any case, just be aware that if you want full control of your excel file, then in most cases, 'xlswrite, xlsread' are not enough, you will have to consider activex(visual basic) which is very simple and interesting.
From: Freek on 15 Apr 2010 10:18 "ade77 " <ade100a(a)gmail.com> wrote in message <hq5d8g$eh5$1(a)fred.mathworks.com>... > > > Thanks ade77. > > > > I was hoping for a simple solution in the xlswrite-line, although this is an interesting option. However, it might be easier to just split up the cell array into several parts (not just two, since there are more rows which are merged) that correspond with cells being merged or not and write all these parts separately to Excel. > > > > I'll think about what I'm going to do, if in the meantime you or anyone else thinks of a quicker solution please let me know. > > Freek, > your option will work, but you will have to manually format it in excel. > For example, if the excel file given to you already contain the merged cells, you will not be able to center the value to appear in E1. > Also, if the excel file given to you does not contain the merged cells, after you write the data into excel, you will have to manually format it to be merged. > > Of course, if you have just 7, or 10 excel files, you can manually do it, but if you have like 500 excel files, or you want to be able to automate it on a regular basis, then activex is a better option. > > In any case, just be aware that if you want full control of your excel file, then in most cases, 'xlswrite, xlsread' are not enough, you will have to consider activex(visual basic) which is very simple and interesting. Thanks for your help ade77. I've tried splitting up the cell array and that does seem to work. The Excel-file does indeed contain the merged cells already (it's kind of a template to which the output is written and then is published to html). When I write a value to 'E1' it is centered and formatted in the merged cells just like I want. So I can't see the problem (yet) that you are pointing out? I don't want to format anything manually, since it concerns about 200 cell arrays that currently all are split up. But it seems I don't have to this way... As you are pointing out, learning to use activex can come in handy, though I will postpone that for now :) Thanks again.
From: ade77 on 16 Apr 2010 15:26 "Freek " <f_van_der_steen(a)hotmail.com> wrote in message <hq776u$mf$1(a)fred.mathworks.com>... > "ade77 " <ade100a(a)gmail.com> wrote in message <hq5d8g$eh5$1(a)fred.mathworks.com>... > > > > > Thanks ade77. > > > > > > I was hoping for a simple solution in the xlswrite-line, although this is an interesting option. However, it might be easier to just split up the cell array into several parts (not just two, since there are more rows which are merged) that correspond with cells being merged or not and write all these parts separately to Excel. > > > > > > I'll think about what I'm going to do, if in the meantime you or anyone else thinks of a quicker solution please let me know. > > > > Freek, > > your option will work, but you will have to manually format it in excel. > > For example, if the excel file given to you already contain the merged cells, you will not be able to center the value to appear in E1. > > Also, if the excel file given to you does not contain the merged cells, after you write the data into excel, you will have to manually format it to be merged. > > > > Of course, if you have just 7, or 10 excel files, you can manually do it, but if you have like 500 excel files, or you want to be able to automate it on a regular basis, then activex is a better option. > > > > In any case, just be aware that if you want full control of your excel file, then in most cases, 'xlswrite, xlsread' are not enough, you will have to consider activex(visual basic) which is very simple and interesting. > > Thanks for your help ade77. > > I've tried splitting up the cell array and that does seem to work. The Excel-file does indeed contain the merged cells already (it's kind of a template to which the output is written and then is published to html). When I write a value to 'E1' it is centered and formatted in the merged cells just like I want. So I can't see the problem (yet) that you are pointing out? > I don't want to format anything manually, since it concerns about 200 cell arrays that currently all are split up. But it seems I don't have to this way... > > As you are pointing out, learning to use activex can come in handy, though I will postpone that for now :) Thanks again. Freek, I am happy it works for you. it worked because the guy who gave you the excel file already formated the merged cells to be centered value. If the cells are just merged without further formatting by the original excel user:not making the horizontal alignment 'centered', then when you write to the excel file, it will be right justified. The important thing for now is that your problem is solved. good luck.
From: Freek on 19 Apr 2010 07:11
Thanks again ade77! |