summaryrefslogtreecommitdiff
path: root/styles.go
diff options
context:
space:
mode:
Diffstat (limited to 'styles.go')
-rw-r--r--styles.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/styles.go b/styles.go
index 272d728..caf2732 100644
--- a/styles.go
+++ b/styles.go
@@ -2676,6 +2676,22 @@ func (f *File) SetConditionalFormat(sheet, area, formatSet string) error {
return err
}
+// UnsetConditionalFormat provides a function to unset the conditional format
+// by given worksheet name and range.
+func (f *File) UnsetConditionalFormat(sheet, area string) error {
+ ws, err := f.workSheetReader(sheet)
+ if err != nil {
+ return err
+ }
+ for i, cf := range ws.ConditionalFormatting {
+ if cf.SQRef == area {
+ ws.ConditionalFormatting = append(ws.ConditionalFormatting[:i], ws.ConditionalFormatting[i+1:]...)
+ return nil
+ }
+ }
+ return nil
+}
+
// drawCondFmtCellIs provides a function to create conditional formatting rule
// for cell value (include between, not between, equal, not equal, greater
// than and less than) by given priority, criteria type and format settings.