Managing Sheet with APIs

SheetAPI.getDefinedNameContent



SheetAPI.getDefinedNameContent method is used to get defined name range content from sheet. .

SHEET_API.getDefinedNameContent( hd, definedNameRange )

Parameters The handle information of the Sheet application your created. The defined name content for the name range.

Returns

The detail content data related to this name range. Such as:
'name mgr'!$B$4:$C$6

Example code


featureFormulaNmgrJson : {
        fileName: 'Formula name mgr',
        sheets: [
            {name: 'name mgr', id: 1, color: 'red' }
        ],
        fileConfig: [
            {name: "rangeData", ctype: "named_func", json: "{\"cal\":\"'name mgr'!$B$4:$C$6\"}" }
        ],
        floatings: [
            { sheet:1, name:"merge1", ftype:"meg", json:"[2,2,2,6]" }
        ],
        cells: [
            {sheet: 1, row: 2, col: 0, json: {height: 30, hoff:0}}, 
            {sheet: 1, row: 0, col: 2, json: {width: 200}},
            {sheet: 1, row: 2, col: 2, json: {data: "Defined a name manager range", fw:"bold", fz:14 }},
        
            { sheet: 1, row: 4, col: 2, json: { data: "2" } },
            { sheet: 1, row: 5, col: 2, json: { data: "3" } },
            { sheet: 1, row: 6, col: 2, json: { data: "4" } },
            { sheet: 1, row: 4, col: 3, json: { data: "5" } },
            { sheet: 1, row: 5, col: 3, json: { data: "6" } },
            { sheet: 1, row: 6, col: 3, json: { data: "7" } },
     
            { sheet: 1, row: 8, col: 2, json: { data: "Defined: rangeData" } },
            { sheet: 1, row: 8, col: 3, json: { data: "B4:C6" } },
            { sheet: 1, row: 9, col: 2, json: { data: "sum(rangeData, 1)" } },
            { sheet: 1, row: 9, col: 3, json: { data: "=sum(rangeData, 1)", cal: "true" } },
            { sheet: 1, row: 10, col: 2, json: { data: "average(rangeData)" } },
            { sheet: 1, row: 10, col: 3, json: { data: "=average(rangeData)", cal: "true" } },
        ]
},

    SHEET_API.getDefinedNameContent(SHEET_API_HD, "rangeData");
 

Result

 

 


Copyright © FeyaSoft Inc. All rights reserved.