$(function() { var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss")); var sheet = spread.getActiveSheet(); var namebox = document.getElementById("namebox"); namebox.value = "A1"; namebox.onkeyup = function() { var val = namebox.value; var spCalc = GC.Spread.Sheets.CalcEngine; var isRef = spCalc.evaluateFormula(sheet, "ISREF(" + val + ")", 0, 0, false); if (isRef) { var row = spCalc.evaluateFormula(sheet, "ROW(" + val + ")", 0, 0, false); var col = spCalc.evaluateFormula(sheet, "COLUMN(" + val + ")", 0, 0, false); //アクティブセルを設定 sheet.setActiveCell(row - 1, col - 1); } }; });
<!-- 名前ボックス --> A1形式のセル参照を入力してください: <input id="namebox" type="text" /> <!-- SpreadJS マークアップ --> <div id="ss"></div>