フィルターのクリア

How can i always check if a cell is written in excel?

3 ビュー (過去 30 日間)
Alexandra Topciov
Alexandra Topciov 2015 年 9 月 10 日
編集済み: Alexandra Topciov 2015 年 10 月 20 日
I want to know if there is a way (a loop or something) to check if it's written every cell in Excel (begging with A1), everytime I press a button in GUI and if it's not written, to write there. ( I already have a code to write in the next row but if i write in A1, A2, A3 and then erase what is written in A2, the next time I press the button it writes in A4, I want it to write in the empty cell A2)

採用された回答

Alexandra Topciov
Alexandra Topciov 2015 年 10 月 20 日
編集済み: Alexandra Topciov 2015 年 10 月 20 日
I have solved the problem. I'm going to leave my example if anyone needs it:D
read Excel sheet
[num,txt,raw]=xlsread('X.xls','X1');
copy data
rowData={Z, X1, Y1, X2, X3, Y0, UP}; (the data i want to write)
make it go to next row
row =(size(raw,1))+1;
search for empty row between data in and if it exists write in it then stop
[nm, nn] = size(raw);
for im=1:nm
NaNIndex = find(isnan(raw{im}));
if NaNIndex==1
xlswrite(...);
break
end
end
if there isn't an empty row write after the last row
if isempty(NaNIndex)
xlswrite(...);
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by