function getexcelfile(app, event)
[file,path]=uigetfile('../*.xlsx');
app.OPS=readtable(file,'ReadVariableNames',0,'TextType','string','TreatAsEmpty',{''})
app.numOPS=width(app.OPS)
set(app.ListBox1,'Enable','on','Visible','on')
set(app.Label,'Visible','on')
for i=1:app.numOPS
O{i}=app.OPS(:,i);
app.ListBox1.Items(i)=cellstr(O{i}{1,1})
end
end
function list1items(app, event)
app.OP{1,1} = app.ListBox1.Value;
for i=1:app.numOPS
O{i}=app.OPS(:,i);
S(i)=cellstr(O{i}{1,1});
end
app.x(1,1)=find(strcmp(S,app.OP{1,1}))
numh=height(O{app.x(1,1)})-1;
for j=1:numh;
app.ListBox2.Items(j)=cellstr(O{app.x(1,1)}{j+1,1});
end
end
3 Comments
Jesus Sanchez (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/495560-app-designer-populate-list-box-with-string-from-excel-file-then-compare-user-input-with-excel-to-po#comment_775940
Holly Huellemeier (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/495560-app-designer-populate-list-box-with-string-from-excel-file-then-compare-user-input-with-excel-to-po#comment_776150
Jesus Sanchez (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/495560-app-designer-populate-list-box-with-string-from-excel-file-then-compare-user-input-with-excel-to-po#comment_776216
Sign in to comment.