How to find the first column without values in excel?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello,
I have an Excel worksheet where I have a certain number of columns of data. I am trying to find the first column which does not have any data so that I can write a vector in that column using xlswrite. I appreciate any help.
0 Kommentare
Akzeptierte Antwort
Richard de Garis
am 18 Apr. 2012
You can try the Excel Range.End property, starting with a cell in a range beyond your data that you know is empty and look back from there. e.g.
Excel = actxGetRunningServer('Excel.Application');
xlworkSheet = Excel.ActiveWorkbook.Worksheets.Item('worksheet_name');
% Excel enumeration according to the help documentation
xlToLeft = -4159;
columnNo = xlworksheet.Range('AAA1').End(xlToLeft);
firstEmptyCol = xlworksheet.Range('A1').offset(0,columnNo-1);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!