File Exchange

image thumbnail

Set conditional formating to Excel

version 1.1.0.0 (1.45 KB) by Tal Shir
Set a conditional format in Excel to change negative numbers text color to red.

2 Downloads

Updated 26 Feb 2009

View Version History

View License

Set a conditional format in Excel to change negative numbers' text color to red.
The code can be modifeid quite easly to set any other condition.
Example:
a=randn(100,1)
xlswrite('a',a)
xlsCondFormNeg('a','Sheet1','A1:A50')

This Example will set the conditional formating to the first 50 numbers in the column.

Cite As

Tal Shir (2021). Set conditional formating to Excel (https://www.mathworks.com/matlabcentral/fileexchange/23107-set-conditional-formating-to-excel), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Arash

Aviator

Great capability. Can you tell me what needs to be changed in this code if I want to set a condition that: when/if any content of for instance 'C1:C10' is less (or) greater than 'B1:B10' turn that cell in the range 'C1:C10', Red???

Thanks,

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!