toAddress(ref) {
        let a, b;
        const sheetName = ref.sheetName;

        if (ref.type === 'cell') {
            a = {
                columnName: ref.columnName,
                columnNumber: ref.columnNumber,
                columnAnchored: ref.columnAnchored,
                rowNumber: ref.rowNumber,
                rowAnchored: ref.rowAnchored
            };
        } else if (ref.type === 'range') {
            a = {
                columnName: ref.startColumnName,
                columnNumber: ref.startColumnNumber,
                columnAnchored: ref.startColumnAnchored,
                rowNumber: ref.startRowNumber,
                rowAnchored: ref.startRowAnchored
            };
            b = {
                columnName: ref.endColumnName,
                columnNumber: ref.endColumnNumber,
                columnAnchored: ref.endColumnAnchored,
                rowNumber: ref.endRowNumber,
                rowAnchored: ref.endRowAnchored
            };
        } else if (ref.type === 'column') {
            a = b = {
                columnName: ref.columnName,
                columnNumber: ref.columnNumber,
                columnAnchored: ref.columnAnchored
            };
        } else if (ref.type === 'row') {
            a = b = {
                rowNumber: ref.rowNumber,
                rowAnchored: ref.rowAnchored
            };
        } else if (ref.type === 'columnRange') {
            a = {
                columnName: ref.startColumnName,
                columnNumber: ref.startColumnNumber,
                columnAnchored: ref.startColumnAnchored
            };
            b = {
                columnName: ref.endColumnName,
                columnNumber: ref.endColumnNumber,
                columnAnchored: ref.endColumnAnchored
            };
        } else if (ref.type === 'rowRange') {
            a = {
                rowNumber: ref.startRowNumber,
                rowAnchored: ref.startRowAnchored
            };
            b = {
                rowNumber: ref.endRowNumber,
                rowAnchored: ref.endRowAnchored
            };
        }

        let address = '';
        if (sheetName) address = `${address}'${sheetName.replace(/'/g, "''")}'!`;
        if (a.columnAnchored) address = `${address}$`;
        if (a.columnName) address = address + a.columnName;
        else if (a.columnNumber) address = address + this.columnNumberToName(a.columnNumber);
        if (a.rowAnchored) address = `${address}$`;
        if (a.rowNumber) address = address + a.rowNumber;

        if (b) {
            address = `${address}:`;
            if (b.columnAnchored) address = `${address}$`;
            if (b.columnName) address = address + b.columnName;
            else if (b.columnNumber) address = address + this.columnNumberToName(b.columnNumber);
            if (b.rowAnchored) address = `${address}$`;
            if (b.rowNumber) address = address + b.rowNumber;
        }

        return address;
    }
Convert a reference object to an address.
@param {{}} ref - The reference object.
@returns {string} The address.