[{"id":"747121ac-49bc-471f-bc1f-0133870ee875","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"39c6ef9f-b47f-468b-8a45-04778ad1454f","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"7f774c2b-b28e-41ae-81ac-183442215b95","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"824f32c9-3d2d-4e0c-8bf9-1c2a80cb5f20","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"da48e9e7-aa3e-48e6-885c-24cd573a865c","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"f2c0b7a3-7408-4bd7-9231-25964deea82b","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"c17720a0-f9c9-40e3-9672-26624219e8d5","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"92fb4492-b5b0-45f0-821d-41746aab90d9","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"1070c201-fb4f-43d9-8ed5-44a24a41b94e","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"53c62891-30fd-4a36-b187-4ec844b88209","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"be16fbd7-0143-464b-a141-58ef3d591d2e","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"c1678172-6644-4e8e-9443-5ca0ad3758b8","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"3598d6df-cd0c-4ef5-8960-64cd765d97bc","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"3e535e34-01bb-4774-8d3a-6586619f935c","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"cec9554a-4f21-49e7-af09-6c064d2fd987","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"2c834bb0-6205-410a-91ae-6f244e77ba67","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"7a798f45-e434-41dd-8eec-767f47c93c6e","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"eb1b46dc-ef67-4261-98bb-77796b51f708","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"a219559a-5427-4a48-82ba-7fd4ebc1b4a2","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"f3565254-b7cd-41df-98ff-93802efb8de4","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"fc8628bd-2baa-4986-86f0-93bca5f0ce6a","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"f9fd9204-20b3-4966-ad86-a67eee8df4e2","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"b4333f37-fda5-41c1-bfbb-a8f2f539a682","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"fab5687c-4d05-4bd4-9d18-b14c696f3e9f","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"3ec14a40-47aa-4569-8e84-b575e1f3107e","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"e102b4d6-1235-42bf-9180-b70ba5ed1fc8","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"81df5251-a207-4b22-a3e7-c8e422b68d47","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"fac5f39e-339c-44de-81d6-c98ce52a7d5b","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]},{"id":"6446ae46-3073-40f5-a385-d3c80d4987f1","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"77595f09-3c3a-4bf7-a628-dca3969f8a48","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"6b1c4c88-5cba-4f4c-9cc3-dcf75a4fa444","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"e979ca93-1262-4139-8ae0-e510fcc6f32f","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"3729e0d4-a56c-4e6e-8f9f-f555dd94e1f8","tags":[{"name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3"}]},{"id":"f088427d-98d8-4ea0-af40-f8d29c80565d","tags":[{"name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa","links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c"}]}]
        
(Showing Draft Content)

カスタム名の作成

ユーザー定義のカスタム名は、シート内の情報を表す識別子の役割を果たします。セル範囲または数式を参照するカスタム名を設定できます。定義したカスタム名は、数式内で使用できます。この場合は、数式の評価時に、カスタム名の値が参照および評価されます。カスタム名を作成するには、addCustomNameメソッドを使用します。

コードの使用

次のサンプルコードは、カスタム名を作成します。

activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 3);

// isReadOnly パラメータを true に設定して、カスタム名を追加します。
activeSheet.addCustomName("customName1","=12", 0, 0, 'readonly', true);

activeSheet.addCustomName("customName2","Average(20,45)", 0, 0);
activeSheet.addCustomName("customName3", "=$B$1:$C$1", 0, 0);

activeSheet.setFormula(1, 0, "customName1");
activeSheet.setFormula(1, 1, "customName2");
activeSheet.setFormula(1, 2, "sum(customName3)");

SpreadJSデザイナの[名前の管理]ダイアログボックスから読み取り専用のカスタム名を変更または削除することはできません。読み取り専用のカスタム名を選択すると、[編集]と[削除]ボタンが無効になり、カスタム名も編集不可の状態になります。読み取り専用のカスタム名は、APIを使用するのみ変更できます。

NameManagerDialog_readOnlyName