/
excelscript.workbookrangeareas.yml
96 lines (91 loc) · 3.25 KB
/
excelscript.workbookrangeareas.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
### YamlMime:TSType
name: ExcelScript.WorkbookRangeAreas
uid: 'ExcelScript!ExcelScript.WorkbookRangeAreas:interface'
package: ExcelScript!
fullName: ExcelScript.WorkbookRangeAreas
summary: Represents a collection of one or more rectangular ranges in multiple worksheets.
remarks: |-
#### Examples
```TypeScript
/**
* This script finds the direct precedents of the active cell.
* It changes the font and color of those precedent cells.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the active cell.
const selected = workbook.getActiveCell();
// Get the cells that are direct precedents of the current cell.
const precedents : ExcelScript.WorkbookRangeAreas = selected.getDirectPrecedents();
// Set the font to bold and the fill color to orange for all the precedent cells.
precedents.getRanges().forEach(range => {
range.getFormat().getFill().setColor("orange");
range.getFormat().getFont().setBold(true);
});
}
```
isPreview: false
isDeprecated: false
type: interface
methods:
- name: getAddresses()
uid: 'ExcelScript!ExcelScript.WorkbookRangeAreas#getAddresses:member(1)'
package: ExcelScript!
fullName: getAddresses()
summary: >-
Returns an array of addresses in A1-style. Address values contain the worksheet name for each rectangular block of
cells (e.g., "Sheet1!A1:B4, Sheet1!D1:D4"). Read-only.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getAddresses(): string[];'
return:
type: 'string[]'
description: ''
- name: getAreas()
uid: 'ExcelScript!ExcelScript.WorkbookRangeAreas#getAreas:member(1)'
package: ExcelScript!
fullName: getAreas()
summary: >-
Returns the `RangeAreasCollection` object. Each `RangeAreas` in the collection represent one or more rectangle
ranges in one worksheet.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getAreas(): RangeAreas[];'
return:
type: '<xref uid="ExcelScript!ExcelScript.RangeAreas:interface" />[]'
description: ''
- name: getRangeAreasBySheet(key)
uid: 'ExcelScript!ExcelScript.WorkbookRangeAreas#getRangeAreasBySheet:member(1)'
package: ExcelScript!
fullName: getRangeAreasBySheet(key)
summary: >-
Returns the `RangeAreas` object based on worksheet name or ID in the collection. If the worksheet does not exist,
then this method returns `undefined`<!-- -->.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getRangeAreasBySheet(key: string): RangeAreas;'
parameters:
- id: key
description: The name or ID of the worksheet.
type: string
return:
type: '<xref uid="ExcelScript!ExcelScript.RangeAreas:interface" />'
description: ''
- name: getRanges()
uid: 'ExcelScript!ExcelScript.WorkbookRangeAreas#getRanges:member(1)'
package: ExcelScript!
fullName: getRanges()
summary: Returns ranges that comprise this object in a `RangeCollection` object.
remarks: ''
isPreview: false
isDeprecated: false
syntax:
content: 'getRanges(): Range[];'
return:
type: '<xref uid="ExcelScript!ExcelScript.Range:interface" />[]'
description: ''