GetType
Returns the type of the above average conditional formatting rule.
Syntax
expression.GetType();
expression - A variable that represents a ApiAboveAverage class.
Parameters
This method doesn't have any parameters.
Returns
Example
Read the category of a conditional formatting rule applied to a range in a spreadsheet.
// How do I find out what kind of conditional formatting rule is active in a spreadsheet?
// Retrieve the rule category to confirm which formatting condition is in use in a spreadsheet.
let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A1").SetValue("Test Data");
worksheet.GetRange("A2").SetValue(10);
worksheet.GetRange("A3").SetValue(20);
worksheet.GetRange("A4").SetValue(30);
worksheet.GetRange("A5").SetValue(40);
worksheet.GetRange("A6").SetValue(50);
let dataRange = worksheet.GetRange("A2:A6");
let formatConditions = dataRange.GetFormatConditions();
let condition = formatConditions.AddAboveAverage();
condition.SetFillColor(Api.CreateColorFromRGB(255, 255, 0));
let conditionType = condition.GetType();
worksheet.GetRange("C1").SetValue("Type:");
worksheet.GetRange("C2").SetValue(conditionType);