matlab to excel conditional formatting using different sheet.
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have some data in a matrix (data) and various checks have been applied on this data (and more) to get a logical array of 'flags'. I would like to write data to excel and highlight the cells which have failed (equal to 1) according the flag array. The flag array will also be written to excel in a separate sheet but will not be formatted.
I am using xlsCondFormNeg from file exchange and have got it working for conditions within data but not by using another sheet Does anyone know how I would change the part of the script below to allow me to format matrix 'data' using logical array 'flags'?
I tried creating a macro in excel to get the VB script and using ['=' range 'Flags!>0'] instead but I get ' Invoke Error, Dispatch Exception: The parameter is incorrect.' I have (probably obviously) little experience with VB beyond the very basic so any help would be appreciated.
ExAct = Excel.Activesheet; ExActRange = get(ExAct,'Range',range); ExActRange.Select;
xlExpression=2; Excel.Selection.FormatConditions.Delete; Excel.Selection.FormatConditions.Add(xlExpression, [], ['=' range '>0']); Excel.Selection.FormatConditions.Item(1).Font.ColorIndex = 3;
thanks
Rachel
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!