设置名称

  1. func (f *File) SetDefinedName(definedName *DefinedName) error

根据给定的名称和作范围设置名称,默认范围是工作簿。例如:

  1. f.SetDefinedName(&excelize.DefinedName{
  2. Name: "Amount",
  3. RefersTo: "Sheet1!$A$2:$D$5",
  4. Comment: "defined name comment",
  5. Scope: "Sheet2",
  6. })