Color the particular row of the excel sheet

조회 수: 22 (최근 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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by