Replace cell text in Excel
조회 수: 6 (최근 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 Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!