summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index e83e456a..6e3512c5 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -326,6 +326,18 @@ module Axlsx
absolute ? r_abs : r
end
+
+ # Creates a defined name in the workbook for this cell.
+ def name=(label)
+ row.worksheet.workbook.add_defined_name "#{row.worksheet.name}!#{r_abs}", name: label
+ @name = label
+ end
+
+ # returns the name of the cell
+ def name
+ @name
+ end
+
private
# we scale the font size if bold style is applied to either the style font or