MATLAB: How to fill color any cell in excel activexexcel Hi I got a trouble. I have an excel table that contains even and odd values I want to find odd values and fill color it like the picture. Thank you very much! Best Answer Use ActiveX, like in the attached demo.The line you want to have is:Excel.Worksheets.Item(1).Range(cellReference).Interior.ColorIndex = cellFillColorIndex; Related SolutionsMATLAB: Color the particular row of the excel sheet % Connect to ExcelExcel = actxserver('excel.application');% Get Workbook objectWB = Excel.Workbooks.Open(fullfile(pwd, 'Book1.xlsx'),0,false);% Set the color of cell "A1" of Sheet 1 to YellowWB.Worksheets.Item(1).Range('A1').Interior.ColorIndex = 6;% Save WorkbookWB.Save();% Close WorkbookWB.Close();% Quit ExcelExcel.Quit();Does this, ofcourse you can change all the values. MATLAB: Excel’s named range through Matlab Hi,this is not possible using xlswrite. You have to do that programatically afterwards using COM/ActiveX, e.g.ex = actxserver('excel.application');ex.Workbooks.Open(fullfile(pwd,'Mappe1.xlsx'));ex.Range('A1:C3').Name = 'RangeName';ex.ActiveWorkbook.Saveex.Quitex.releaseSo do a xlswrite to write down the data and afterwards create the named ranges. Related QuestionHow to rename a sheet in Excel using the COM interface in MATLABMoving excel sheets within excel fileGet information from Excel file based on cell color
Best Answer