Color the particular row of the excel sheet

23 ビュー (過去 30 日間)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2015 年 5 月 8 日
I need to color the particular row of the excel sheet. How can i do this ?

採用された回答

Thomas Koelen
Thomas Koelen 2015 年 5 月 8 日
編集済み: Thomas Koelen 2015 年 5 月 8 日
% Connect to Excel
Excel = actxserver('excel.application');
% Get Workbook object
WB = Excel.Workbooks.Open(fullfile(pwd, 'Book1.xlsx'),0,false);
% Set the color of cell "A1" of Sheet 1 to Yellow
WB.Worksheets.Item(1).Range('A1').Interior.ColorIndex = 6;
% Save Workbook
WB.Save();
% Close Workbook
WB.Close();
% Quit Excel
Excel.Quit();
Does this, ofcourse you can change all the values.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by