Color the particular row of the excel sheet
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gopalakrishnan venkatesan
le 8 Mai 2015
Commenté : Gopalakrishnan venkatesan
le 8 Mai 2015
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/149917/image.jpeg)
I need to color the particular row of the excel sheet. How can i do this ?
0 commentaires
Réponse acceptée
Thomas Koelen
le 8 Mai 2015
Modifié(e) : Thomas Koelen
le 8 Mai 2015
% 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Spreadsheets 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!