How to set Excel cell color to from Matlab using R1C1 range notation?
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This question is related to this one:
https://www.mathworks.com/matlabcentral/answers/3352-how-to-set-excel-cell-color-to-red-from-matlab
And the question is, can the Range be specifed in R1C1 notation rather than A1 notation? And if so, how?
WB.Worksheets.Item(1).Range('A1').Interior.ColorIndex = 3;
I have tried the following with no success:
WB.Worksheets.Item(1).Range(cells(i+1,j+1),cells(i+1,j+1)).Interior.ColorIndex = str2double(outTblColor{i,j});
Thanks for the help.
2 comentarios
Allen
el 29 de En. de 2020
As alternative to trying to work with R1C1 notation (never was successful using this via ActiveX), you could use the xlscol function (FileExchange) to convert R1C1 input to the standard A1 notation.
The following code segment shows one way of converting your i and j variables to row and columns text, respectively.
A1notation = sprintf('%s%s',xlscol(j),i+48); % Adding 48 to i corrects for ASCII values of numeric characters.
Respuestas (0)
Ver también
Categorías
Más información sobre ActiveX en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!