R1C1 形式で Excel 内のセルにアクセスする方法はありますか?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 25 Oct 2013
Modifié(e) : MathWorks Support Team
le 2 Oct 2015
Active X を利用して Excel にアクセスしています。セルの範囲を取得する際、下記のように A1 形式で与えることは可能ですが
e.Activesheet.get('Range', 'A1:B2');
下記のような R1C1 形式(行と列ともに数値)で与える方法を教えてください。
Range(.Cells(1, 1), .Cells(10, 10))
Réponse acceptée
MathWorks Support Team
le 2 Oct 2015
各セルを Cells メソッドを使って事前に取得してご利用ください。
exl = actxserver('Excel.Application');
exlWkbk = exl.Workbooks;
exlFile = exlWkbk.Open('XXXXXXX'); % ファイルをオープン
Activesheet = exlFile.Activesheet;
fromCells = get(Activesheet, 'Cells', 1, 1); % 開始のセル
toCells = get(Activesheet, 'Cells', 2, 2); % 終了のセル
eActivesheetRange = get(Activesheet, 'Range', fromCells, toCells);
eActivesheetRange.Value
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur スプレッドシート dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!