I am wondering how I can clear or delete ranges of cells in excel using Matlab, for example range (a1:f100).
I am beginner and I spend so much time on this, If you know it is a great help for me.
Thank you very much in advance,
Hi,
You can use "xlsread" to open an excel file. Then delete the portion of the data you wish and save the changed data as excel file using "xlswrite".
But you should consider that you will loose formats of the cells (color, font etc.) when you save data as *.xls using "xlswrite". If you want to keep the formatting too, you can check File Exchange for other functions to create *.xls.
Regards.
Thank you very much. I am wondering with
>> Then delete the portion of the data you wish and save the changed data as excel file using "xlswrite". <<
you mean writing something like space over the old data or actually delete my data.
I tried writing space (' ') on those cells but my graphs will be screwed. Therefore I prefer clear or delete command if exists.
I have 700000 rows and so many sheets.
Waiting for your helppppppppp
Thanks
"John " <onsekiz...@yahoo.co.uk> wrote in message <id6hkp$g2a$1...@fred.mathworks.com>...
ImageAnalyst’s way is following:
excel = actxserver('Excel.Application');
file = excel.Workbooks.Open('yourExcelFile.xls’);
sheet1=excel.Worksheets.get('Item', 'yourSheetName');
range1=get(sheet1,'Range', 'StartCell','EndCell');
% In your case: range1=get(sheet1,'Range', 'A1','F'100);
range1.Value=[];
file.Save;
file.Close;
delete(excel);
Do the steps one by one.
Regards.
---------------------------
This way will be much faster since you'll only have to launch and
shutdown Excel once instead of twice, plus you'll preserve any
formatting of the cells. Each call to xlsread or xlswrite would cause
Excel to launch and shutdown.
Hi, i have others situation similar to this problem.
I have few sheets of 3columns x 757rows data in .xls file, now i want to delete 11th,30th,49th,68th,........ row (in other word is every 19rows) for every sheet.
May i know how to solve this problem? Thanks for helping~