Skip to content

Commit 78a8a43

Browse files
kenny-not-deadr.sergeev
andauthored
Update docs for the SetDefinedName function (#2229)
Co-authored-by: r.sergeev <[email protected]>
1 parent f0a56d6 commit 78a8a43

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

sheet.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1733,7 +1733,6 @@ func (f *File) GetPageLayout(sheet string) (PageLayoutOptions, error) {
17331733
// Name: "Amount",
17341734
// RefersTo: "Sheet1!$A$2:$D$5",
17351735
// Comment: "defined name comment",
1736-
// Scope: "Sheet2",
17371736
// })
17381737
//
17391738
// If you fill the RefersTo property with only one columns range without a
@@ -1753,6 +1752,14 @@ func (f *File) GetPageLayout(sheet string) (PageLayoutOptions, error) {
17531752
// RefersTo: "Sheet1!$1:$1",
17541753
// Scope: "Sheet1",
17551754
// })
1755+
//
1756+
// You can also use the function in RefersTo. For example:
1757+
//
1758+
// err := f.SetDefinedName(&excelize.DefinedName{
1759+
// Name: "CustomRange",
1760+
// RefersTo: "Sheet1!$A$2+Sheet1!$D$5",
1761+
// Scope: "Sheet1",
1762+
// })
17561763
func (f *File) SetDefinedName(definedName *DefinedName) error {
17571764
if definedName.Name == "" || definedName.RefersTo == "" {
17581765
return ErrParameterInvalid

0 commit comments

Comments
 (0)