How to use offset function of excel vba in Matlab coding environment????
6 次查看(过去 30 天)
显示 更早的评论
thanks!!!
first_m = objSheet.Range('A:Z').Find('month').offset(0,1).Address;
my 'month' is in cell A1, my target cell is A2, my code is listed below.
objExcel = actxserver('excel.application');
set(objExcel, 'Visible',1);
sheetName = 'DPLLC';
objSheet = objExcel.Worksheets.get('Item', sheetName);
first_m = objSheet.Range('A:Z').Find('month').offset(2,1).Address;
but give me error like ??? 'Subscript indices must either be real positive integers or logicals.'
2 个评论
采纳的回答
Sean de Wolski
2011-8-2
Matlab indexing starts at 1 not 0.
first_m = objSheet.Range('A:Z').Find('month').offset(1,1).Address;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!