summaryrefslogtreecommitdiff
path: root/sheet.go
diff options
context:
space:
mode:
Diffstat (limited to 'sheet.go')
-rw-r--r--sheet.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/sheet.go b/sheet.go
index aaa72cc..44067fe 100644
--- a/sheet.go
+++ b/sheet.go
@@ -37,8 +37,9 @@ import (
// appending the new sheet.
func (f *File) NewSheet(name string) int {
// Check if the worksheet already exists
- if f.GetSheetIndex(name) != -1 {
- return f.SheetCount
+ index := f.GetSheetIndex(name)
+ if index != -1 {
+ return index
}
f.DeleteSheet(name)
f.SheetCount++