Products

Back to the Documentation

Defined Names

Define a name for a cell or a range of cells. Apply those to your formulas to create clear expressions.

Documentation

Methods

Available methods

Method Description
getDefinedNames Get a defined name.
getDefinedNames(index: String) => Object
@Param string - defined names identification.
setDefinedNames Create a new defined name.
setDefinedNames(names: Array) => void
@param {array} - Array with the new defined names.

Settings

All available properties to define a validation

Property Description
definedNames: array An array of defined names

Example

Initiate the spreadsheet with defined names.

<html>
<script src="https://jspreadsheet.com/v9/jspreadsheet.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v9/jspreadsheet.css" type="text/css" />
<script src="https://jsuites.net/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/jsuites.css" type="text/css" />

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

<div id="spreadsheet"></div>

<script>
let set = function() {
    // Create a new defined name
    spreadsheet[0].setDefinedNames([{
        index: 'Calculations',
        value: 'Sheet1!A1:A6',
    }]);
}

// Set the extension
jspreadsheet.setExtensions({ formula });

// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('ZTk5ZjgyNmMwNWI3Yjc3NDQwNmY0YWI4ZDE2NjdmNjBkYWM2MWFhNjkwMWVlZmFlYzkyNGFlNmJlZWE1ZTYyNDkyNmMxNDk0MzQxYjY4YmZkNDYxZmJlYWQ4MTJlOGNhYjhmY2RkMWQ3YjgwYjkzNGNkM2FiODExYTYyZWJlNzcsZXlKamJHbGxiblJKWkNJNklpSXNJbTVoYldVaU9pSktjM0J5WldGa2MyaGxaWFFpTENKa1lYUmxJam94TnpNeU16VXdOelUxTENKa2IyMWhhVzRpT2xzaWFuTndjbVZoWkhOb1pXVjBMbU52YlNJc0ltTnZaR1Z6WVc1a1ltOTRMbWx2SWl3aWFuTm9aV3hzTG01bGRDSXNJbU56WWk1aGNIQWlMQ0ozWldJaUxDSnNiMk5oYkdodmMzUWlYU3dpY0d4aGJpSTZJak0wSWl3aWMyTnZjR1VpT2xzaWRqY2lMQ0oyT0NJc0luWTVJaXdpZGpFd0lpd2lkakV4SWl3aVkyaGhjblJ6SWl3aVptOXliWE1pTENKbWIzSnRkV3hoSWl3aWNHRnljMlZ5SWl3aWNtVnVaR1Z5SWl3aVkyOXRiV1Z1ZEhNaUxDSnBiWEJ2Y25SbGNpSXNJbUpoY2lJc0luWmhiR2xrWVhScGIyNXpJaXdpYzJWaGNtTm9JaXdpY0hKcGJuUWlMQ0p6YUdWbGRITWlMQ0pqYkdsbGJuUWlMQ0p6WlhKMlpYSWlMQ0p6YUdGd1pYTWlYU3dpWkdWdGJ5STZkSEoxWlgwPQ==');

// Create a new spreadsheet
let spreadsheet = jspreadsheet(document.getElementById('spreadsheet'), {
    toolbar: true,
    worksheets: [{
        data: [
            [10, "=SUM(Summary)"],
            [20, ""],
            [30, ""],
            [40, ""],
            [50, ""]
        ],
        minDimensions: [6, 6],
    }],
    definedNames: {
        Summary: 'Sheet1!A1:A6',
    }
});
</script>
</html>