Replace cell text in Excel
4 次查看(过去 30 天)
显示 更早的评论
How can I replace a cell's text in Excel with another text?
%%DATA INPUT FROM PRESPECIFIED EXCEL FILE
[~, text, ~] = xlsread('input.xlsx');
Country = text(1,1)
% Replace text in cell A1 in input.xlsx with another text here
%%EXPORTS OUTPUT DATA TO PRESPECIFIED FILE
filename = 'output.xlsx';
A = [Country];
sheet = 1;
xlRange = 'A2';
xlswrite(filename,A,sheet,xlRange)
0 个评论
回答(2 个)
Image Analyst
2018-3-24
Why not
xlswrite(filename,Country,sheet,xlRange)
Country should be a cell with a string inside of it, so this should work.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Identification 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!