matlab to excel conditional formatting using different sheet.

조회 수: 1 (최근 30일)
Rachel
Rachel 2012년 1월 9일
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개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by