how to delete cells in excel and the cells below move up
3 views (last 30 days)
Show older comments
I need to delete cells in excel and have the cells below move up. Right now my code has the cells to the right move left.
Thanks for your help.
my code follows:
[n5, nonwords] = xlsread('notwords.xls', 'A1:B50');
nonwordlist = cell(1:50,1);
nonwordlist = nonwords(1:50);
n5(1:50,:);
n5 = double(n5);
excel = actxserver ('Excel.Application');
% excel.Visible = 1;
workbook = excel.Workbooks.Open('C:\Documents and Settings\Fordham\My Documents\MATLAB\notwords.xls');
% Activate the sheet you need (optional if the sheet is the first)
workbook.Worksheets.Item(1).Activate
workbook.ActiveSheet.Range('A1:B50').Delete;
% Now save/close/quit/delete
% excel.Visible = 0;
workbook.Save
excel.Workbook.Close
invoke(excel, 'Quit');
delete(excel);
0 Comments
Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!