フィルターのクリア

Replace cell text in Excel

6 ビュー (過去 30 日間)
Bjarte
Bjarte 2018 年 3 月 24 日
回答済み: Bjarte 2018 年 3 月 24 日
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)

回答 (2 件)

Image Analyst
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.

Bjarte
Bjarte 2018 年 3 月 24 日
I am not sure if that works in my case. I am trying to run a function with input parameters from input.xlsx, and export resulting outputs to output.xlsx. Once finished, it should change one of the input parameters in input.xlsx, and export the new output.

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by