refersToRange property

Range refersToRange
getter/setter pair

Represents the referred worksheet range for the named range.

final Workbook workbook = Workbook();
final Worksheet worksheet = workbook.worksheets[0];
worksheet.getRangeByName('A1:D4').setText('Hello');
final Name name1 = workbook.names.add('Title');
name1.refersToRange = worksheet.getRangeByName('A1:C1');
final Name name2 = worksheet.names.add('Body');
name2.refersToRange = worksheet.getRangeByName('A2:C2');
final List<int> bytes = workbook.saveAsStream();
saveAsExcel(bytes, 'refersToRange.xlsx');
workbook.dispose();

Implementation

late Range refersToRange;