{"id":21128,"date":"2025-12-02T10:51:59","date_gmt":"2025-12-02T01:51:59","guid":{"rendered":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/?p=21128"},"modified":"2025-12-02T11:04:28","modified_gmt":"2025-12-02T02:04:28","slug":"%e3%82%b9%e3%83%97%e3%83%ac%e3%83%83%e3%83%89%e3%82%b7%e3%83%bc%e3%83%88%e3%81%a7%e3%83%a1%e3%83%a2%e3%82%92%e5%b8%b8%e3%81%ab%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8b%e3%81%ab%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/21128\/","title":{"rendered":"\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30e1\u30e2\u3092\u5e38\u306b\u8868\u793a\u3059\u308b\u306b\u306f\uff1f\u30e1\u30e2\u6a5f\u80fd\u306e\u4f7f\u3044\u65b9\u3084\u81ea\u52d5\u5316\uff08GAS\uff09\u307e\u3067"},"content":{"rendered":"<p>Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\uff08Google Sheets\uff09\u306e\u30e1\u30e2\u6a5f\u80fd\u306f\u3001\u30bb\u30eb\u306b\u88dc\u8db3\u60c5\u5831\u3092\u8ffd\u52a0\u3067\u304d\u308b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u901a\u5e38\u306f\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u6642\u306e\u307f\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u91cd\u8981\u306a\u60c5\u5831\u3092\u898b\u9003\u3057\u304c\u3061\u3067\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u30e1\u30e2\u3092\u5e38\u6642\u8868\u793a\u3055\u305b\u308b\u65b9\u6cd5\u3084\u3001Google Apps Script\uff08GAS\uff09\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u8868\u793a\u5236\u5fa1\u307e\u3067\u3001\u521d\u5fc3\u8005\u3067\u3082\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002\u30b3\u30e1\u30f3\u30c8\u6a5f\u80fd\u3068\u306e\u9055\u3044\u3084\u3001\u696d\u52d9\u3067\u306e\u52b9\u679c\u7684\u306a\u6d3b\u7528\u65b9\u6cd5\u3082\u542b\u3081\u3066\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30e1\u30e2\u6a5f\u80fd\u3092\u6700\u5927\u9650\u306b\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div id=\"post-below-intro\"><\/div><h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30e1\u30e2\u6a5f\u80fd\u3068\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30e1\u30e2\u6a5f\u80fd\u3068\u306f\u3001\u30bb\u30eb\u306b\u88dc\u8db3\u60c5\u5831\u3092\u4ed8\u52a0\u3067\u304d\u308b\u6a5f\u80fd\u3067\u3001\u30bb\u30eb\u306b\u30de\u30a6\u30b9\u30ab\u30fc\u30bd\u30eb\u3092\u5408\u308f\u305b\u308b\u3068\u9ec4\u8272\u3044\u5439\u304d\u51fa\u3057\u3067\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/b><\/span>\u30c7\u30fc\u30bf\u306e\u80cc\u666f\u60c5\u5831\u3084\u8a08\u7b97\u6839\u62e0\u3001\u6ce8\u610f\u4e8b\u9805\u306a\u3069\u3092\u8a18\u9332\u3067\u304d\u3001\u30b7\u30fc\u30c8\u306e\u53ef\u8aad\u6027\u3092\u4fdd\u3061\u306a\u304c\u3089\u8a73\u7d30\u60c5\u5831\u3092\u7ba1\u7406\u3067\u304d\u308b\u91cd\u8981\u306a\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u30e1\u30e2\u6a5f\u80fd\u306e\u4e3b\u306a\u7279\u5fb4\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u70b9\u304c\u6319\u3052\u3089\u308c\u307e\u3059\u3002\u30e1\u30e2\u306f\u30bb\u30eb\u3068\u4e00\u4f53\u5316\u3057\u3066\u7ba1\u7406\u3055\u308c\u3001\u30bb\u30eb\u306e\u30b3\u30d4\u30fc\u30fb\u79fb\u52d5\u6642\u3082\u4e00\u7dd2\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u5370\u5237\u6642<\/strong>\uff1a\u65e2\u5b9a\u3067\u306f\u975e\u8868\u793a\u3060\u304c\u3001\u5370\u5237\u8a2d\u5b9a\u3067\u30e1\u30e2\uff0f\u30b3\u30e1\u30f3\u30c8\u3092\u542b\u3081\u3066\u51fa\u529b\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3002<\/p>\n<p>\u8907\u6570\u30e6\u30fc\u30b6\u30fc\u3067\u306e\u5171\u540c\u7de8\u96c6\u6642\u3082\u3001\u5404\u81ea\u304c\u30e1\u30e2\u3092\u8ffd\u52a0\u30fb\u7de8\u96c6\u3067\u304d\u3001\u60c5\u5831\u5171\u6709\u306e\u52b9\u7387\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30e1\u30e2\u3068\u30b3\u30e1\u30f3\u30c8\u306e\u9055\u3044\u306f\uff1f<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30e1\u30e2\u306f\u5358\u7d14\u306a\u6ce8\u91c8\u6a5f\u80fd\u3067\u3042\u308b\u306e\u306b\u5bfe\u3057\u3001\u30b3\u30e1\u30f3\u30c8\u306f\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u3068\u306e\u3084\u308a\u53d6\u308a\u304c\u53ef\u80fd\u306a\u5bfe\u8a71\u578b\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/b><\/span>\u3053\u306e\u9055\u3044\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u7528\u9014\u306b\u5fdc\u3058\u305f\u9069\u5207\u306a\u6a5f\u80fd\u9078\u629e\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u6a5f\u80fd\u306e\u6bd4\u8f03<\/h4>\n<table>\n<thead>\n<tr>\n<th width=\"20%\">\u9805\u76ee<\/th>\n<th width=\"30%\">\u30e1\u30e2<\/th>\n<th width=\"50%\">\u30b3\u30e1\u30f3\u30c8<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">\u8868\u793a\u65b9\u6cd5<\/td>\n<td style=\"text-align: left;\">\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u6642<\/td>\n<td style=\"text-align: left;\">\u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u8868\u793a\uff08\u30b9\u30ec\u30c3\u30c9\u3092\u958b\u3044\u305f\u6642\uff0f\u30b5\u30a4\u30c9\u30d1\u30cd\u30eb\u8868\u793a\u4e2d\u306b\u5185\u5bb9\u304c\u898b\u3048\u308b\uff09<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u8fd4\u4fe1\u6a5f\u80fd<\/td>\n<td style=\"text-align: left;\">\u306a\u3057<\/td>\n<td style=\"text-align: left;\">\u3042\u308a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u901a\u77e5\u6a5f\u80fd<\/td>\n<td style=\"text-align: left;\">\u306a\u3057<\/td>\n<td style=\"text-align: left;\">\u30e1\u30f3\u30b7\u30e7\u30f3\u53ef\u80fd<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u89e3\u6c7a\u30de\u30fc\u30af<\/td>\n<td style=\"text-align: left;\">\u306a\u3057<\/td>\n<td style=\"text-align: left;\">\u3042\u308a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">\u4e3b\u306a\u7528\u9014<\/td>\n<td style=\"text-align: left;\">\u9759\u7684\u306a\u60c5\u5831\u8a18\u9332<\/td>\n<td style=\"text-align: left;\">\u52d5\u7684\u306a\u3084\u308a\u53d6\u308a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u30e1\u30e2\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u306f\uff1f<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30e1\u30e2\u3092\u8ffd\u52a0\u3059\u308b\u306b\u306f\u3001\u30bb\u30eb\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c\u30e1\u30e2\u3092\u633f\u5165\u300d\u3092\u9078\u629e\u3059\u308b\u304b\u3001\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u30ad\u30fcShift+F2\uff08Windows\uff09\u307e\u305f\u306fShift+Fn+F2\uff08Mac\uff09\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/b><\/span>\u3053\u306e\u7c21\u5358\u306a\u64cd\u4f5c\u3067\u3001\u4efb\u610f\u306e\u30bb\u30eb\u306b\u88dc\u8db3\u8aac\u660e\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u30e1\u30e2\u8ffd\u52a0\u306e\u8a73\u7d30\u624b\u9806<\/strong><\/span><\/div>\n<ol class=\"summary-box__list summary-box__list--number\">\n<li>\u30e1\u30e2\u3092\u8ffd\u52a0\u3057\u305f\u3044\u30bb\u30eb\u3092\u9078\u629e<\/li>\n<li>\u53f3\u30af\u30ea\u30c3\u30af\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c\u30e1\u30e2\u3092\u633f\u5165\u300d\u3092\u30af\u30ea\u30c3\u30af<\/li>\n<li>\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u306b\u5185\u5bb9\u3092\u5165\u529b<\/li>\n<li>\u30bb\u30eb\u5916\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u78ba\u5b9a<\/li>\n<\/ol>\n<\/div>\n<p>\u30e1\u30e2\u304c\u8ffd\u52a0\u3055\u308c\u305f\u30bb\u30eb\u306b\u306f\u3001\u53f3\u4e0a\u306b\u5c0f\u3055\u306a\u9ed2\u3044\u4e09\u89d2\u30de\u30fc\u30af\u304c\u8868\u793a\u3055\u308c\u3001\u30e1\u30e2\u306e\u5b58\u5728\u3092\u8996\u899a\u7684\u306b\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3067\u30e1\u30e2\u3092\u5e38\u306b\u8868\u793a\u3055\u305b\u308b\u6a19\u6e96\u7684\u306a\u65b9\u6cd5\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>\u6b8b\u5ff5\u306a\u304c\u3089\u3001Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u6a19\u6e96\u6a5f\u80fd\u3067\u306f\u3001\u30e1\u30e2\u3092\u5e38\u6642\u8868\u793a\u3055\u305b\u308b\u76f4\u63a5\u7684\u306a\u8a2d\u5b9a\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/b><\/span>\u3057\u304b\u3057\u3001\u3044\u304f\u3064\u304b\u306e\u4ee3\u66ff\u65b9\u6cd5\u3084\u56de\u907f\u7b56\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u985e\u4f3c\u306e\u52b9\u679c\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6a19\u6e96\u6a5f\u80fd\u3067\u306e\u4ee3\u66ff\u6848\u3068\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u65b9\u6cd5\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u3002<\/p>\n<div class=\"summary-box\">\n<ol class=\"summary-box__list summary-box__list--number\">\n<li>\u30b3\u30e1\u30f3\u30c8\u6a5f\u80fd\u3078\u306e\u5207\u308a\u66ff\u3048\n<ul>\n<li>\u30e1\u30e2\u306e\u4ee3\u308f\u308a\u306b\u30b3\u30e1\u30f3\u30c8\u3092\u4f7f\u7528<\/li>\n<li>\u30b3\u30e1\u30f3\u30c8\u306f\u753b\u9762\u53f3\u5074\u306b\u4e00\u89a7\u8868\u793a\u53ef\u80fd<\/li>\n<li>\u300c\u30b3\u30e1\u30f3\u30c8\u5c65\u6b74\u3092\u958b\u304f\u300d\u3067\u5e38\u6642\u78ba\u8a8d<\/li>\n<\/ul>\n<\/li>\n<li>\u5c02\u7528\u5217\u306e\u4f5c\u6210\n<ul>\n<li>\u30e1\u30e2\u5185\u5bb9\u3092\u5225\u5217\u306b\u8a18\u8f09<\/li>\n<li>\u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u3067\u8996\u8a8d\u6027\u3092\u5411\u4e0a<\/li>\n<li>\u30d5\u30a3\u30eb\u30bf\u30fc\u6a5f\u80fd\u3067\u8868\u793a\/\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048<\/li>\n<\/ul>\n<\/li>\n<li>\u56f3\u5f62\u63cf\u753b\u3067\u306e\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u6d3b\u7528\n<ul>\n<li>\u300c\u633f\u5165\u300d\u2192\u300c\u63cf\u753b\u300d\u3067\u30c6\u30ad\u30b9\u30c8\u30dc\u30c3\u30af\u30b9\u3092\u4f5c\u6210<\/li>\n<li>\u30bb\u30eb\u306e\u4e0a\u306b\u914d\u7f6e\u3057\u3066\u64ec\u4f3c\u7684\u306a\u30e1\u30e2\u3068\u3057\u3066\u4f7f\u7528<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div>\n<h2>Google Apps Script\uff08GAS\uff09\u3067\u30e1\u30e2\u3092\u5e38\u306b\u8868\u793a\u3055\u305b\u308b\u65b9\u6cd5\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>GAS\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30e1\u30e2\u306e\u5185\u5bb9\u3092\u81ea\u52d5\u7684\u306b\u5225\u306e\u30bb\u30eb\u3084\u30b5\u30a4\u30c9\u30d0\u30fc\u306b\u8868\u793a\u3055\u305b\u3001\u5b9f\u8cea\u7684\u306b\u5e38\u6642\u8868\u793a\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/b><\/span>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u3088\u308b\u67d4\u8edf\u306a\u5236\u5fa1\u306b\u3088\u308a\u3001\u6a19\u6e96\u6a5f\u80fd\u3067\u306f\u4e0d\u53ef\u80fd\u306a\u8868\u793a\u65b9\u6cd5\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u57fa\u672c\u7684\u306aGAS\u30b3\u30fc\u30c9\u3067\u30e1\u30e2\u5185\u5bb9\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30e1\u30e2\u306e\u5185\u5bb9\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3001getNote()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u3001\u53d6\u5f97\u3057\u305f\u5185\u5bb9\u3092\u5225\u306e\u5834\u6240\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/b><\/span>\u4ee5\u4e0b\u306f\u3001\u9078\u629e\u3057\u305f\u30bb\u30eb\u306e\u30e1\u30e2\u3092\u96a3\u306e\u5217\u306b\u8868\u793a\u3059\u308b\u57fa\u672c\u7684\u306a\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>javascript<\/p>\n<p>function displayNoteInNextColumn() {<\/p>\n<p>\/\/ \u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u53d6\u5f97<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const activeCell = sheet.getActiveCell();<\/p>\n<p>\/\/ \u30e1\u30e2\u306e\u5185\u5bb9\u3092\u53d6\u5f97<\/p>\n<p>const noteContent = activeCell.getNote();<\/p>\n<p>\/\/ \u30e1\u30e2\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u3001\u96a3\u306e\u5217\u306b\u8868\u793a<\/p>\n<p>if (noteContent) {<\/p>\n<p>const row = activeCell.getRow();<\/p>\n<p>const col = activeCell.getColumn();<\/p>\n<p>sheet.getRange(row, col + 1).setValue(noteContent);}}<\/p>\n<h3>\u30b5\u30a4\u30c9\u30d0\u30fc\u3067\u30e1\u30e2\u3092\u5e38\u6642\u8868\u793a\u3059\u308bGAS\u306e\u5b9f\u88c5<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u300c\u5e38\u6642\u8868\u793a\uff08\u81ea\u52d5\u66f4\u65b0\uff09\u300d\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u30b5\u30a4\u30c9\u30d0\u30fc\uff08HTML\uff09\u304b\u3089\u5b9a\u671f\u7684\u306b getSelectedCellNote() \u3092\u547c\u3073\u51fa\u3059\u65b9\u5f0f\u304c\u7c21\u5358\u3067\u78ba\u5b9f\u3067\u3059\u3002<\/b><\/span>\u4ee5\u4e0b\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>Code.gs\uff08\u8ffd\u52a0\uff0f\u4fee\u6b63\uff09<\/strong><\/p>\n<p>function onOpen() {<\/p>\n<p>SpreadsheetApp.getUi()<\/p>\n<p>.createMenu(&#8216;\u30e1\u30e2\u8868\u793a&#8217;)<\/p>\n<p>.addItem(&#8216;\u30b5\u30a4\u30c9\u30d0\u30fc\u3092\u8868\u793a&#8217;, &#8216;showSidebar&#8217;)<\/p>\n<p>.addToUi();}<\/p>\n<p>function showSidebar() {<\/p>\n<p>const html = HtmlService.createHtmlOutputFromFile(&#8216;sidebar&#8217;)<\/p>\n<p>.setTitle(&#8216;\u30e1\u30e2\u8868\u793a\u30d1\u30cd\u30eb&#8217;)<\/p>\n<p>.setWidth(300);<\/p>\n<p>SpreadsheetApp.getUi().showSidebar(html);}<\/p>\n<p>\/\/ \u9078\u629e\u30bb\u30eb\u306e\u30e1\u30e2\u3092\u8fd4\u3059\uff08\u7a7a\u306a\u3089\u7a7a\u6587\u5b57\uff09<\/p>\n<p>function getSelectedCellNote() {<\/p>\n<p>const range = SpreadsheetApp.getActive().getActiveRange();<\/p>\n<p>const note = range ? range.getNote() : &#8221;;<\/p>\n<p>return {<\/p>\n<p>address: range ? range.getA1Notation() : &#8221;,<\/p>\n<p>note: note || &#8221;\u00a0\u00a0};}<\/p>\n<p><strong>sidebar.html\uff08\u65b0\u898f\u4f5c\u6210\uff09<\/strong><\/p>\n<p>&lt;!doctype html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>body { font: 14px\/1.6 system-ui, -apple-system, &#8220;Segoe UI&#8221;, Roboto, sans-serif; margin: 12px; }<\/p>\n<p>.addr { color:#666; font-size:12px; margin-bottom:6px; }<\/p>\n<p>pre { white-space:pre-wrap; word-wrap:break-word; border:1px solid #ddd; padding:8px; border-radius:8px; }<\/p>\n<p>.empty { color:#999; font-style:italic; }<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;div class=&#8221;addr&#8221; id=&#8221;addr&#8221;&gt;&lt;\/div&gt;<\/p>\n<p>&lt;pre id=&#8221;note&#8221; class=&#8221;empty&#8221;&gt;\uff08\u30e1\u30e2\u306f\u3042\u308a\u307e\u305b\u3093\uff09&lt;\/pre&gt;<\/p>\n<p>&lt;script&gt;<\/p>\n<p>const addrEl = document.getElementById(&#8216;addr&#8217;);<\/p>\n<p>const noteEl = document.getElementById(&#8216;note&#8217;);<\/p>\n<p>function refresh() {<\/p>\n<p>google.script.run.withSuccessHandler(({address, note}) =&gt; {<\/p>\n<p>addrEl.textContent = address ? `\u9078\u629e\u4e2d: ${address}` : &#8221;;<\/p>\n<p>if (note &amp;&amp; note.trim()) {<\/p>\n<p>noteEl.textContent = note;<\/p>\n<p>noteEl.classList.remove(&#8216;empty&#8217;);<\/p>\n<p>} else {<\/p>\n<p>noteEl.textContent = &#8216;\uff08\u30e1\u30e2\u306f\u3042\u308a\u307e\u305b\u3093\uff09&#8217;;<\/p>\n<p>noteEl.classList.add(&#8216;empty&#8217;);}<\/p>\n<p>}).getSelectedCellNote();}<\/p>\n<p>\/\/ \u8d77\u52d5\u6642\uff06\u5b9a\u671f\u66f4\u65b0\uff08500ms\u301c1000ms \u7a0b\u5ea6\u304c\u76ee\u5b89\uff09<\/p>\n<p>refresh();<\/p>\n<p>setInterval(refresh, 800);<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<p><strong>\u88dc\u8db3<\/strong>\uff1a\u30dd\u30fc\u30ea\u30f3\u30b0\u304c\u6c17\u306b\u306a\u308b\u5834\u5408\u306f\u3001<strong>\u5358\u7d14\u30c8\u30ea\u30ac\u30fc onSelectionChange(e) <\/strong>\u3092\u4f7f\u3063\u3066\u9078\u629e\u30a2\u30c9\u30ec\u30b9\u3092 PropertiesService \u306b\u4fdd\u5b58\u3057\u3001\u30b5\u30a4\u30c9\u30d0\u30fc\u306f\u305d\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u65b9\u5f0f\u3067\u3082\u5b9f\u73fe\u3067\u304d\u307e\u3059\uff08\u305f\u3060\u3057\u30b5\u30a4\u30c9\u30d0\u30fc\u3078\u306e\u76f4\u63a5\u66f4\u65b0\u306f\u3067\u304d\u306a\u3044\u305f\u3081\u3001\u6700\u7d42\u7684\u306b\u306f\u30b5\u30a4\u30c9\u30d0\u30fc\u5074\u306e\u53d6\u5f97\u51e6\u7406\u304c\u5fc5\u8981\u3067\u3059\uff09\u3002<\/p>\n<p>HTML\u30d5\u30a1\u30a4\u30eb\uff08sidebar.html\uff09\uff1a<\/p>\n<p>html<\/p>\n<p>&lt;!DOCTYPE html&gt;<\/p>\n<p>&lt;html&gt;<\/p>\n<p>&lt;head&gt;<\/p>\n<p>&lt;base target=&#8221;_top&#8221;&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>body {<\/p>\n<p>font-family: Arial, sans-serif;<\/p>\n<p>padding: 10px;}<\/p>\n<p>#note-content {<\/p>\n<p>background-color: #fffacd;<\/p>\n<p>padding: 10px;<\/p>\n<p>border-radius: 5px;<\/p>\n<p>margin-top: 10px;<\/p>\n<p>min-height: 100px;}<\/p>\n<p>button {<\/p>\n<p>background-color: #4CAF50;<\/p>\n<p>color: white;<\/p>\n<p>padding: 10px;<\/p>\n<p>border: none;<\/p>\n<p>border-radius: 5px;<\/p>\n<p>cursor: pointer;<\/p>\n<p>width: 100%;}<\/p>\n<p>&lt;\/style&gt;<\/p>\n<p>&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h3&gt;\u30bb\u30eb\u306e\u30e1\u30e2\u8868\u793a&lt;\/h3&gt;<\/p>\n<p>&lt;button onclick=&#8221;updateNote()&#8221;&gt;\u30e1\u30e2\u3092\u66f4\u65b0&lt;\/button&gt;<\/p>\n<p>&lt;div id=&#8221;cell-info&#8221;&gt;&lt;\/div&gt;<\/p>\n<p>&lt;pre id=&#8221;note-content&#8221;&gt;&lt;\/pre&gt;<\/p>\n<p>&lt;script&gt;<\/p>\n<p>function updateNote() {<\/p>\n<p>google.script.run<\/p>\n<p>.withSuccessHandler(displayNote)<\/p>\n<p>.withFailureHandler(() =&gt; displayNote({address:&#8221;, note:&#8221;}))<\/p>\n<p>.getSelectedCellNote();}<\/p>\n<p>function displayNote(data) {<\/p>\n<p>&lt;div id=&#8221;cell-info&#8221;&gt;&lt;strong&gt;\u30bb\u30eb\uff1a&lt;\/strong&gt;&lt;span id=&#8221;cell-addr&#8221;&gt;&lt;\/span&gt;&lt;\/div&gt;<\/p>\n<p>&lt;pre id=&#8221;note-content&#8221;&gt;&lt;\/pre&gt;<\/p>\n<p>&lt;script&gt;<\/p>\n<p>function updateNote() {<\/p>\n<p>google.script.run<\/p>\n<p>.withSuccessHandler(displayNote)<\/p>\n<p>.withFailureHandler(() =&gt; displayNote({address:&#8221;, note:&#8221;}))<\/p>\n<p>.getSelectedCellNote();}<\/p>\n<p>function displayNote(data) {<\/p>\n<p>const addrEl = document.getElementById(&#8216;cell-addr&#8217;);<\/p>\n<p>const noteEl = document.getElementById(&#8216;note-content&#8217;);<\/p>\n<p>const addr = (data &amp;&amp; data.address) ? data.address : &#8221;;<\/p>\n<p>const note = (data &amp;&amp; typeof data.note === &#8216;string&#8217;) ? data.note : &#8221;;<\/p>\n<p>addrEl.textContent = addr || &#8216;\uff08\u672a\u9078\u629e\uff09&#8217;;<\/p>\n<p>noteEl.textContent = note.trim() ? note : &#8216;\uff08\u30e1\u30e2\u306f\u3042\u308a\u307e\u305b\u3093\uff09&#8217;;}<\/p>\n<p>updateNote();<\/p>\n<p>setInterval(updateNote, 5000);<\/p>\n<p>&lt;\/script&gt;}<\/p>\n<p>\/\/ \u521d\u671f\u8868\u793a<\/p>\n<p>updateNote();<\/p>\n<p>\/\/ \u5b9a\u671f\u7684\u306b\u66f4\u65b0\uff085\u79d2\u3054\u3068\uff09<\/p>\n<p>setInterval(updateNote, 5000);<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>&lt;\/body&gt;<\/p>\n<p>&lt;\/html&gt;<\/p>\n<h2>\u30e1\u30e2\u3092\u4e00\u89a7\u8868\u793a\u3059\u308bGAS\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u4f5c\u6210\u65b9\u6cd5\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>\u30b7\u30fc\u30c8\u5185\u306e\u3059\u3079\u3066\u306e\u30e1\u30e2\u3092\u4e00\u89a7\u8868\u793a\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3001\u30e1\u30e2\u306e\u5168\u4f53\u50cf\u3092\u628a\u63e1\u3057\u3001\u7ba1\u7406\u3092\u52b9\u7387\u5316\u3067\u304d\u307e\u3059\u3002<\/b><\/span>\u7279\u5b9a\u306e\u30b7\u30fc\u30c8\u3084\u7bc4\u56f2\u306b\u542b\u307e\u308c\u308b\u30e1\u30e2\u3092\u62bd\u51fa\u3057\u3001\u5225\u30b7\u30fc\u30c8\u306b\u307e\u3068\u3081\u3066\u8868\u793a\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<h3>\u3059\u3079\u3066\u306e\u30e1\u30e2\u3092\u5225\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u300c\u3059\u3079\u3066\u306e\u30e1\u30e2\u300d\u3092\u6b63\u78ba\u306b\u62bd\u51fa\u3059\u308b\u306b\u306f\u3001\u30b7\u30fc\u30c8\u306e\u5168\u30b0\u30ea\u30c3\u30c9\uff08getMaxRows()\u00d7getMaxColumns()\uff09\u3092\u5bfe\u8c61\u306b getNotes() \u3092\u7528\u3044\u3066\u8d70\u67fb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/b><\/span>\u5927\u898f\u6a21\u30b7\u30fc\u30c8\u3067\u306f\u51e6\u7406\u8ca0\u8377\u304c\u9ad8\u304f\u306a\u308b\u305f\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5bfe\u8c61\u30b7\u30fc\u30c8\u306e\u884c\u30fb\u5217\u6570\u3092\u7e2e\u5c0f\u3057\u3066\u304b\u3089\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bb\u30eb\u306e\u30a2\u30c9\u30ec\u30b9\u3001\u30e1\u30e2\u5185\u5bb9\u3001\u62bd\u51fa\u65e5\u6642\uff08\u5b9f\u884c\u6642\u523b\uff09 \u306a\u3069\u306e\u60c5\u5831\u3092\u542b\u3081\u308b\u3053\u3068\u3067\u3001\u30e1\u30e2\u306e\u7ba1\u7406\u304c\u5bb9\u6613\u306b\u306a\u308a\u307e\u3059\u3002\u203b\u30e1\u30e2\u306e\u66f4\u65b0\u65e5\u6642\u306f Apps Script \u304b\u3089\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u300c\u3059\u3079\u3066\u306e\u30e1\u30e2\u300d\u3092\u6b63\u78ba\u306b\u62bd\u51fa\u3059\u308b\u306b\u306f\u3001\u30b7\u30fc\u30c8\u306e\u5168\u30b0\u30ea\u30c3\u30c9\uff08getMaxRows()\u00d7getMaxColumns()\uff09\u3092\u5bfe\u8c61\u306b getNotes() \u3092\u7528\u3044\u3066\u8d70\u67fb\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u5927\u898f\u6a21\u30b7\u30fc\u30c8\u3067\u306f\u51e6\u7406\u8ca0\u8377\u304c\u9ad8\u304f\u306a\u308b\u305f\u3081\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u5bfe\u8c61\u30b7\u30fc\u30c8\u306e\u884c\u30fb\u5217\u6570\u3092\u7e2e\u5c0f\u3057\u3066\u304b\u3089\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p><strong>[\u4fee\u6b63\u304c\u5fc5\u8981\u306a\u6587\u7ae0]<\/strong><\/p>\n<p>\u4e8c\u91cd\u30eb\u30fc\u30d7\u5185\u3067 getRange().getNote() \u30921\u30bb\u30eb\u305a\u3064\u547c\u3073\u51fa\u3059\u5b9f\u88c5<\/p>\n<p><strong>[\u4fee\u6b63\u304c\u5fc5\u8981\u306a\u7406\u7531]<\/strong><\/p>\n<p>\u30bb\u30eb\u5358\u4f4d\u306e\u53d6\u5f97\u306f<strong>\u8457\u3057\u304f\u975e\u52b9\u7387<\/strong>\u3067\u3001\u5b9f\u884c\u6642\u9593\u8d85\u904e\u306e\u8981\u56e0\u306b\u306a\u308a\u307e\u3059\u3002Range.getNotes()\uff0fRange.getDisplayValues() \u306a\u3069\u306e<strong>\u4e00\u62ec\u53d6\u5f97<\/strong>\u306b\u7f6e\u304d\u63db\u3048\u308b\u3079\u304d\u3067\u3059\u3002<\/p>\n<p><strong>[\u4fee\u6b63\u5f8c\u306e\u6587\u7ae0]\uff08\u7f6e\u304d\u63db\u3048\u30b3\u30fc\u30c9\uff09<\/strong><\/p>\n<p>function exportAllNotesToNewSheet() {<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const ss = sheet.getParent();<\/p>\n<p>\/\/ \u51fa\u529b\u5148\u30b7\u30fc\u30c8\u306e\u7528\u610f<\/p>\n<p>const outName = &#8216;\u30e1\u30e2\u4e00\u89a7_&#8217; + sheet.getName();<\/p>\n<p>const existing = ss.getSheetByName(outName);<\/p>\n<p>if (existing) ss.deleteSheet(existing);<\/p>\n<p>const out = ss.insertSheet(outName);<\/p>\n<p>const headers = [&#8216;\u30bb\u30eb\u756a\u5730&#8217;, &#8216;\u30bb\u30eb\u306e\u5024&#8217;, &#8216;\u30e1\u30e2\u5185\u5bb9&#8217;, &#8216;\u62bd\u51fa\u65e5\u6642&#8217;];<\/p>\n<p>out.getRange(1, 1, 1, headers.length).setValues([headers]).setFontWeight(&#8216;bold&#8217;);<\/p>\n<p>\/\/ \u2605\u30dd\u30a4\u30f3\u30c8\uff1a\u30b7\u30fc\u30c8\u5168\u4f53\u3092\u5bfe\u8c61\u306b\u30e1\u30e2\u3092\u4e00\u62ec\u53d6\u5f97\uff08\u672c\u5f53\u306b\u300c\u5168\u90e8\u300d\u62fe\u3046\u5834\u5408\uff09<\/p>\n<p>const rows = sheet.getMaxRows();<\/p>\n<p>const cols = sheet.getMaxColumns();<\/p>\n<p>const rng\u00a0 = sheet.getRange(1, 1, rows, cols);<\/p>\n<p>const notes = rng.getNotes();\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ 2\u6b21\u5143\u914d\u5217\uff08\u5404\u30bb\u30eb\u306e\u30e1\u30e2\uff09<\/p>\n<p>const values = rng.getDisplayValues(); \u00a0 \u00a0 \/\/ \u8868\u793a\u5024\u3092\u307e\u3068\u3081\u3066\u53d6\u5f97<\/p>\n<p>const now = new Date();<\/p>\n<p>const data = [];<\/p>\n<p>for (let r = 0; r &lt; rows; r++) {<\/p>\n<p>for (let c = 0; c &lt; cols; c++) {<\/p>\n<p>const note = notes[r][c];<\/p>\n<p>if (note) {<\/p>\n<p>data.push([toA1(r + 1, c + 1), values[r][c], note, now]);}}}<\/p>\n<p>if (data.length) {<\/p>\n<p>out.getRange(2, 1, data.length, headers.length).setValues(data);<\/p>\n<p>out.autoResizeColumns(1, headers.length);<\/p>\n<p>out.setFrozenRows(1);<\/p>\n<p>out.getRange(2, 3, data.length, 1).setBackground(&#8216;#FFFACD&#8217;); \/\/ \u30e1\u30e2\u5217\u3092\u5f37\u8abf}<\/p>\n<p>SpreadsheetApp.getUi().alert(<\/p>\n<p>`\u30e1\u30e2\u306e\u62bd\u51fa\u5b8c\u4e86nn\u62bd\u51fa\u3055\u308c\u305f\u30e1\u30e2\u6570: ${data.length}\u4ef6n\u51fa\u529b\u5148\u30b7\u30fc\u30c8: ${outName}`);}<\/p>\n<p>\/\/ \u5217\u756a\u53f7\u2192A1\u306e\u5217\u8a18\u6cd5\uff081\u2192A, 27\u2192AA\uff09<\/p>\n<p>function toA1(row, col) {<\/p>\n<p>let s = &#8221;;<\/p>\n<p>while (col &gt; 0) {<\/p>\n<p>const m = (col &#8211; 1) % 26;<\/p>\n<p>s = String.fromCharCode(65 + m) + s;<\/p>\n<p>col = (col &#8211; 1 &#8211; m) \/ 26;}<\/p>\n<p>return s + row;}<\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u904b\u7528\u30e1\u30e2<\/strong><\/span><\/div>\n<ul class=\"summary-box__list summary-box__list\">\n<li>\u30b7\u30fc\u30c8\u304c\u975e\u5e38\u306b\u5927\u304d\u3044\u5834\u5408\u306f\u3001\u9ad8\u8ca0\u8377\u56de\u907f\u306e\u305f\u3081\u300c\u5bfe\u8c61\u5217\u30fb\u5bfe\u8c61\u884c\u3092\u4e8b\u524d\u306b\u7e2e\u5c0f\u300d\u3059\u308b\u304b\u3001\u300c\u5024\u306e\u3042\u308b\u9818\u57df\uff08getLastRow()\/getLastColumn()\uff09\u3068\u5fc5\u8981\u9818\u57df\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u300d\u306a\u3069\u3067\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f\u300c\u66f4\u65b0\u65e5\u6642\u300d\u3067\u306f\u306a\u304f<strong>\u62bd\u51fa\u65e5\u6642<\/strong>\u3092\u51fa\u529b\u3057\u307e\u3059\u3002\u30e1\u30e2\u306e\u66f4\u65b0\u6642\u523b\u306f\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3002<\/li>\n<\/ul>\n<\/div>\n<h3>\u7279\u5b9a\u6761\u4ef6\u306e\u30e1\u30e2\u306e\u307f\u3092\u62bd\u51fa\u3059\u308b\u9ad8\u5ea6\u306a\u30b9\u30af\u30ea\u30d7\u30c8<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3084\u65e5\u4ed8\u30d5\u30a3\u30eb\u30bf\u306a\u3069\u3001\u7279\u5b9a\u306e\u6761\u4ef6\u306b\u5408\u81f4\u3059\u308b\u30e1\u30e2\u3060\u3051\u3092\u62bd\u51fa\u3059\u308b\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u5927\u91cf\u306e\u30e1\u30e2\u304b\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u52b9\u7387\u7684\u306b\u898b\u3064\u3051\u3089\u308c\u307e\u3059\u3002<\/b><\/span><\/p>\n<p>javascript<\/p>\n<p>function searchNotesWithKeyword() {<\/p>\n<p>const ui = SpreadsheetApp.getUi();<\/p>\n<p>const res = ui.prompt(&#8216;\u30e1\u30e2\u691c\u7d22&#8217;, &#8216;\u30e1\u30e2\u306b\u542b\u307e\u308c\u308b\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044:&#8217;, ui.ButtonSet.OK_CANCEL);<\/p>\n<p>if (res.getSelectedButton() !== ui.Button.OK) return;<\/p>\n<p>const keyword = (res.getResponseText() || &#8221;).trim().toLowerCase();<\/p>\n<p>if (!keyword) {<\/p>\n<p>ui.alert(&#8216;\u691c\u7d22\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002&#8217;);<\/p>\n<p>return;}<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>\/\/ \u2605\u30dd\u30a4\u30f3\u30c8\uff1a\u30b7\u30fc\u30c8\u5168\u4f53\u3092\u5bfe\u8c61\u306b\u4e00\u62ec\u53d6\u5f97\uff08\u7a7a\u30bb\u30eb\u306b\u4ed8\u3044\u305f\u30e1\u30e2\u3082\u62fe\u3046\uff09<\/p>\n<p>const rows = sheet.getMaxRows();<\/p>\n<p>const cols = sheet.getMaxColumns();<\/p>\n<p>if (rows === 0 || cols === 0) {<\/p>\n<p>ui.alert(&#8216;\u5bfe\u8c61\u30b7\u30fc\u30c8\u306b\u30bb\u30eb\u304c\u3042\u308a\u307e\u305b\u3093\u3002&#8217;);<\/p>\n<p>return;}<\/p>\n<p>const rng\u00a0 \u00a0 = sheet.getRange(1, 1, rows, cols);<\/p>\n<p>const notes\u00a0 = rng.getNotes();\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \/\/ 2\u6b21\u5143\u914d\u5217<\/p>\n<p>const values = rng.getDisplayValues();\u00a0 \u00a0 \/\/ 2\u6b21\u5143\u914d\u5217\uff08\u8868\u793a\u5024\uff09<\/p>\n<p>const results = [];<\/p>\n<p>for (let r = 0; r &lt; rows; r++) {<\/p>\n<p>for (let c = 0; c &lt; cols; c++) {<\/p>\n<p>const note = notes[r][c];<\/p>\n<p>if (note &amp;&amp; note.toLowerCase().includes(keyword)) {<\/p>\n<p>results.push({<\/p>\n<p>address: toA1(r + 1, c + 1),<\/p>\n<p>value: values[r][c],<\/p>\n<p>note: note,<\/p>\n<p>row: r + 1,<\/p>\n<p>col: c + 1<\/p>\n<p>});}}}<\/p>\n<p>if (results.length) {<\/p>\n<p>highlightCellsWithMatchingNotes(results);<\/p>\n<p>showSearchResultsSidebar(results, keyword);<\/p>\n<p>} else {<\/p>\n<p>ui.alert(&#8216;\u691c\u7d22\u7d50\u679c&#8217;, `\u300c${keyword}\u300d\u3092\u542b\u3080\u30e1\u30e2\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002`, ui.ButtonSet.OK);<\/p>\n<p>}}<\/p>\n<p>\/\/ \u76f4\u524d\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u306e\u307f\u89e3\u9664\u3057\u3066\u304b\u3089\u4eca\u56de\u5206\u3092\u5857\u308b<\/p>\n<p>function highlightCellsWithMatchingNotes(results) {<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const props = PropertiesService.getDocumentProperties();<\/p>\n<p>\/\/ \u76f4\u524d\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u3092\u89e3\u9664<\/p>\n<p>const prev = JSON.parse(props.getProperty(&#8216;prevHighlighted&#8217;) || &#8216;[]&#8217;);<\/p>\n<p>if (prev.length) {<\/p>\n<p>sheet.getRangeList(prev).setBackground(null); \/\/ \u76f4\u63a5\u6307\u5b9a\u306e\u80cc\u666f\u306e\u307f\u89e3\u9664\uff08\u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u306f\u7dad\u6301\uff09}<\/p>\n<p>\/\/ \u4eca\u56de\u306e\u30cf\u30a4\u30e9\u30a4\u30c8<\/p>\n<p>const a1s = results.map(r =&gt; r.address);<\/p>\n<p>if (a1s.length) sheet.getRangeList(a1s).setBackground(&#8216;#FFD700&#8217;);<\/p>\n<p>\/\/ \u8a18\u9332\u66f4\u65b0<\/p>\n<p>props.setProperty(&#8216;prevHighlighted&#8217;, JSON.stringify(a1s));}<\/p>\n<p>\/\/ \u691c\u7d22\u7d50\u679c\u3092\u30b5\u30a4\u30c9\u30d0\u30fc\u306b\u5b89\u5168\u8868\u793a\uff08HTML\u30a8\u30b9\u30b1\u30fc\u30d7\uff09<\/p>\n<p>function showSearchResultsSidebar(results, keyword) {<\/p>\n<p>const esc = s =&gt; String(s ?? &#8221;).replace(\/[&amp;&lt;&gt;&#8221;&#8216;]\/g, m =&gt; (<\/p>\n<p>{ &#8216;&amp;&#8217;:&#8217;&amp;amp;&#8217;, &#8216;&lt;&#8216;:&#8217;&amp;lt;&#8217;, &#8216;&gt;&#8217;:&#8217;&amp;gt;&#8217;, &#8216;&#8221;&#8216;:&#8217;&amp;quot;&#8217;, &#8220;&#8216;&#8221;:&#8217;&amp;#39;&#8217; }[m]));<\/p>\n<p>const rows = results.map(r =&gt;<\/p>\n<p>`&lt;tr&gt;<\/p>\n<p>&lt;td&gt;${esc(r.address)}&lt;\/td&gt;<\/p>\n<p>&lt;td&gt;${esc(r.value)}&lt;\/td&gt;<\/p>\n<p>&lt;td class=&#8221;note&#8221;&gt;${esc(r.note)}&lt;\/td&gt;<\/p>\n<p>&lt;\/tr&gt;`).join(&#8221;);<\/p>\n<p>const html = HtmlService.createHtmlOutput(<\/p>\n<p>`&lt;!doctype html&gt;<\/p>\n<p>&lt;html&gt;&lt;head&gt;&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/p>\n<p>&lt;style&gt;<\/p>\n<p>body{font:14px\/1.6 system-ui, -apple-system, &#8220;Segoe UI&#8221;, Roboto, sans-serif; margin:12px}<\/p>\n<p>h3{margin:0 0 8px}<\/p>\n<p>table{border-collapse:collapse; width:100%}<\/p>\n<p>th,td{border:1px solid #ddd; padding:6px; vertical-align:top}<\/p>\n<p>td.note{background:#FFFACD; white-space:pre-wrap}<\/p>\n<p>&lt;\/style&gt;&lt;\/head&gt;<\/p>\n<p>&lt;body&gt;<\/p>\n<p>&lt;h3&gt;\u30e1\u30e2\u691c\u7d22\u7d50\u679c\uff1a\u300c${esc(keyword)}\u300d&lt;\/h3&gt;<\/p>\n<p>&lt;div&gt;\u30d2\u30c3\u30c8\u4ef6\u6570\uff1a${results.length}&lt;\/div&gt;<\/p>\n<p>&lt;table&gt;<\/p>\n<p>&lt;thead&gt;&lt;tr&gt;&lt;th&gt;\u30bb\u30eb\u756a\u5730&lt;\/th&gt;&lt;th&gt;\u30bb\u30eb\u306e\u5024&lt;\/th&gt;&lt;th&gt;\u30e1\u30e2&lt;\/th&gt;&lt;\/tr&gt;&amp;lt;\/thead&gt;<\/p>\n<p>&lt;tbody&gt;${rows || &#8216;&lt;tr&gt;&lt;td colspan=&#8221;3&#8243;&gt;\u8a72\u5f53\u306a\u3057&lt;\/td&gt;&lt;\/tr&gt;&#8217;}&lt;\/tbody&gt;<\/p>\n<p>&lt;\/table&gt;<\/p>\n<p>&lt;\/body&gt;&lt;\/html&gt;`<\/p>\n<p>).setTitle(&#8216;\u30e1\u30e2\u691c\u7d22\u7d50\u679c&#8217;).setWidth(540);<\/p>\n<p>SpreadsheetApp.getUi().showSidebar(html);}<\/p>\n<p>\/\/ \u5217\u756a\u53f7\u2192A1\u8a18\u6cd5\uff081\u2192A, 27\u2192AA\uff09<\/p>\n<p>function toA1(row, col) {<\/p>\n<p>let s = &#8221;;<\/p>\n<p>while (col &gt; 0) {<\/p>\n<p>const m = (col &#8211; 1) % 26;<\/p>\n<p>s = String.fromCharCode(65 + m) + s;<\/p>\n<p>col = (col &#8211; 1 &#8211; m) \/ 26;}<\/p>\n<p>return s + row;}<\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u88dc\u8db3\uff08\u4efb\u610f\u306e\u6700\u9069\u5316\uff09<\/strong><\/span><\/div>\n<ul class=\"summary-box__list summary-box__list\">\n<li>\u30b7\u30fc\u30c8\u304c\u5de8\u5927\u3067\u5168\u8d70\u67fb\u304c\u91cd\u3044\u5834\u5408\u306f\u3001getLastRow()\/getLastColumn() \u3067\u5bfe\u8c61\u3092\u7e2e\u5c0f\u3059\u308b\u3001\u3082\u3057\u304f\u306f\u691c\u7d22\u5bfe\u8c61\u30b7\u30fc\u30c8\u3092\u5206\u3051\u308b\u904b\u7528\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li>\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u305f\u3044\u5834\u5408\u306f .toLowerCase() \u3092\u5916\u3057\u3001includes(keyword) \u306e\u4ee3\u308f\u308a\u306b indexOf(keyword) &gt;= 0 \u306a\u3069\u3078\u8abf\u6574\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/div>\n<h2>\u30e1\u30e2\u6a5f\u80fd\u3092\u696d\u52d9\u3067\u52b9\u679c\u7684\u306b\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>\u30e1\u30e2\u6a5f\u80fd\u3092\u696d\u52d9\u3067\u6700\u5927\u9650\u6d3b\u7528\u3059\u308b\u306b\u306f\u3001\u30c1\u30fc\u30e0\u5185\u3067\u30eb\u30fc\u30eb\u3092\u7d71\u4e00\u3057\u3001\u5b9a\u671f\u7684\u306a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3092\u884c\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/b><\/span>\u5358\u306a\u308b\u5099\u5fd8\u9332\u3068\u3057\u3066\u3067\u306f\u306a\u304f\u3001\u696d\u52d9\u30d7\u30ed\u30bb\u30b9\u306e\u4e00\u90e8\u3068\u3057\u3066\u7d44\u307f\u8fbc\u3080\u3053\u3068\u3067\u3001\u60c5\u5831\u5171\u6709\u306e\u8cea\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7ba1\u7406\u3067\u306e\u6d3b\u7528\u4f8b<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u7ba1\u7406\u306b\u304a\u3044\u3066\u306f\u3001\u30bf\u30b9\u30af\u306e\u8a73\u7d30\u60c5\u5831\u3084\u9032\u6357\u306e\u80cc\u666f\u8aac\u660e\u3092\u30e1\u30e2\u306b\u8a18\u9332\u3059\u308b\u3053\u3068\u3067\u3001\u30e1\u30a4\u30f3\u306e\u30b7\u30fc\u30c8\u3092\u30b7\u30f3\u30d7\u30eb\u306b\u4fdd\u3061\u306a\u304c\u3089\u5fc5\u8981\u306a\u60c5\u5831\u3092\u7ba1\u7406\u3067\u304d\u307e\u3059\u3002<\/b><\/span><\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u52b9\u679c\u7684\u306a\u6d3b\u7528\u30d1\u30bf\u30fc\u30f3<\/strong><\/span><\/div>\n<ul class=\"summary-box__list summary-box__list\">\n<li>\u30bf\u30b9\u30af\u7ba1\u7406\u30b7\u30fc\u30c8\uff1a\u5404\u30bf\u30b9\u30af\u306e\u8a73\u7d30\u306a\u8981\u4ef6\u3084\u6ce8\u610f\u4e8b\u9805\u3092\u30e1\u30e2\u306b\u8a18\u8f09<\/li>\n<li>\u4e88\u7b97\u7ba1\u7406\u8868\uff1a\u8cbb\u7528\u306e\u5185\u8a33\u3084\u627f\u8a8d\u7d4c\u7def\u3092\u30e1\u30e2\u3067\u88dc\u8db3<\/li>\n<li>\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u8868\uff1a\u65e5\u7a0b\u5909\u66f4\u306e\u7406\u7531\u3084\u95a2\u9023\u3059\u308b\u4f1a\u8b70\u60c5\u5831\u3092\u8a18\u9332<\/li>\n<\/ul>\n<\/div>\n<h3>\u30c7\u30fc\u30bf\u5206\u6790\u3067\u306e\u6d3b\u7528\u65b9\u6cd5<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30c7\u30fc\u30bf\u5206\u6790\u3067\u306f\u3001\u6570\u5024\u306e\u80cc\u666f\u306b\u3042\u308b\u4eee\u5b9a\u3084\u8a08\u7b97\u6839\u62e0\u3092\u30e1\u30e2\u306b\u6b8b\u3059\u3053\u3068\u3067\u3001\u5f8c\u304b\u3089\u898b\u8fd4\u3057\u305f\u969b\u306e\u7406\u89e3\u3092\u52a9\u3051\u3001\u5206\u6790\u306e\u518d\u73fe\u6027\u3092\u9ad8\u3081\u307e\u3059\u3002<\/b><\/span><\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u5206\u6790\u696d\u52d9\u3067\u306e\u5177\u4f53\u4f8b<\/strong><\/span><\/div>\n<ul class=\"summary-box__list summary-box__list\">\n<li>\u7570\u5e38\u5024\u306e\u8aac\u660e\uff1a\u30c7\u30fc\u30bf\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u3067\u9664\u5916\u3057\u305f\u7406\u7531<\/li>\n<li>\u8a08\u7b97\u5f0f\u306e\u88dc\u8db3\uff1a\u8907\u96d1\u306a\u8a08\u7b97\u306e\u8003\u3048\u65b9\u3084\u53c2\u7167\u5143<\/li>\n<li>\u4eee\u5b9a\u306e\u8a18\u9332\uff1a\u4e88\u6e2c\u30e2\u30c7\u30eb\u3067\u4f7f\u7528\u3057\u305f\u524d\u63d0\u6761\u4ef6<\/li>\n<\/ul>\n<\/div>\n<h3>\u30c1\u30fc\u30e0\u3067\u306e\u30e1\u30e2\u904b\u7528\u30eb\u30fc\u30eb<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30c1\u30fc\u30e0\u5168\u4f53\u3067\u30e1\u30e2\u306e\u66f8\u304d\u65b9\u3084\u4f7f\u3044\u65b9\u306e\u30eb\u30fc\u30eb\u3092\u5b9a\u3081\u308b\u3053\u3068\u3067\u3001\u60c5\u5831\u306e\u4e00\u8cab\u6027\u3068\u691c\u7d22\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/b><\/span>\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30eb\u30fc\u30eb\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n<div class=\"summary-box\">\n<div class=\"summary-box__title\"><span class=\"summary-box__title_tag\"><strong>\u63a8\u5968\u30eb\u30fc\u30eb\u306e\u4f8b<\/strong><\/span><\/div>\n<ol class=\"summary-box__list summary-box__list--number\">\n<li>\u8a18\u8f09\u5f62\u5f0f\u306e\u7d71\u4e00<br \/>\n[\u65e5\u4ed8]\u8a18\u8f09\u8005\u540d<br \/>\n\u5185\u5bb9\uff1a\u301c\u301c\u301c<br \/>\n\u7406\u7531\uff1a\u301c\u301c\u301c<\/li>\n<li>\u30ab\u30c6\u30b4\u30ea\u30bf\u30b0\u306e\u4f7f\u7528\n<ul>\n<li>#\u91cd\u8981\uff1a\u512a\u5148\u5ea6\u306e\u9ad8\u3044\u60c5\u5831<\/li>\n<li>#\u78ba\u8a8d\u6e08\uff1a\u30ec\u30d3\u30e5\u30fc\u5b8c\u4e86<\/li>\n<li>#\u8981\u66f4\u65b0\uff1a\u60c5\u5831\u306e\u66f4\u65b0\u304c\u5fc5\u8981<\/li>\n<\/ul>\n<\/li>\n<li>\u5b9a\u671f\u7684\u306a\u68da\u5378\u3057\n<ul>\n<li>\u6708\u6b21\u3067\u30e1\u30e2\u306e\u6574\u7406<\/li>\n<li>\u4e0d\u8981\u306a\u30e1\u30e2\u306e\u524a\u9664<\/li>\n<li>\u91cd\u8981\u30e1\u30e2\u306e\u6587\u66f8\u5316<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div>\n<h2>\u30e1\u30e2\u306e\u8868\u793a\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308bGAS\u5fdc\u7528\u30c6\u30af\u30cb\u30c3\u30af\u306f\uff1f<\/h2>\n<p><span style=\"background-color: #ffff99;\"><b>GAS\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30e1\u30e2\u306e\u8868\u793a\u65b9\u6cd5\u3092\u696d\u52d9\u30cb\u30fc\u30ba\u306b\u5408\u308f\u305b\u3066\u81ea\u7531\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3067\u304d\u307e\u3059\u3002<\/b><\/span>\u6761\u4ef6\u306b\u5fdc\u3058\u305f\u52d5\u7684\u306a\u8868\u793a\u3084\u3001\u8996\u899a\u7684\u306a\u30a4\u30f3\u30b8\u30b1\u30fc\u30bf\u30fc\u306e\u8ffd\u52a0\u306a\u3069\u3001\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u91cd\u8981\u5ea6\u306b\u5fdc\u3058\u3066\u30e1\u30e2\u3092\u8272\u5206\u3051\u8868\u793a\u3059\u308b<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u30e1\u30e2\u306e\u5185\u5bb9\u306b\u7279\u5b9a\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u30bb\u30eb\u306e\u8272\u3092\u81ea\u52d5\u7684\u306b\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u3001\u91cd\u8981\u306a\u60c5\u5831\u3092\u898b\u9003\u3055\u306a\u3044\u3088\u3046\u306b\u3067\u304d\u307e\u3059\u3002<\/b><\/span><\/p>\n<p>javascript<\/p>\n<p>\/** \u30e1\u30cb\u30e5\u30fc\u8ffd\u52a0\uff08\u62e1\u5f35\u6a5f\u80fd \u2192 \u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3001\u3067\u3082\u53ef\uff09 *\/<\/p>\n<p>function onOpen() {<\/p>\n<p>SpreadsheetApp.getUi()<\/p>\n<p>.createMenu(&#8216;\u30e1\u30e2\u30c4\u30fc\u30eb&#8217;)<\/p>\n<p>.addItem(&#8216;\u30e1\u30e2\u3067\u8272\u5206\u3051\u3092\u5b9f\u884c&#8217;, &#8216;colorCellsByNoteContent&#8217;)<\/p>\n<p>.addItem(&#8216;\u76f4\u524d\u306e\u8272\u5206\u3051\u3092\u89e3\u9664&#8217;, &#8216;clearLastNoteColoring&#8217;)<\/p>\n<p>.addToUi();}<\/p>\n<p>\/** \u8272\u5206\u3051\u30eb\u30fc\u30eb\u3092\u3053\u3053\u3067\u5b9a\u7fa9 *\/<\/p>\n<p>const NOTE_COLOR_RULES = {<\/p>\n<p>&#8216;\u91cd\u8981&#8217;: &#8216;#FF6B6B&#8217;, \u00a0 \/\/ \u8d64<\/p>\n<p>&#8216;\u78ba\u8a8d&#8217;: &#8216;#FFD93D&#8217;, \u00a0 \/\/ \u9ec4<\/p>\n<p>&#8216;\u5b8c\u4e86&#8217;: &#8216;#6BCF7F&#8217;, \u00a0 \/\/ \u7dd1<\/p>\n<p>&#8216;\u4fdd\u7559&#8217;: &#8216;#95E1D3&#8217;\u00a0 \u00a0 \/\/ \u9752\u7dd1};<\/p>\n<p>\/** \u30e1\u30e2\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u30bb\u30eb\u80cc\u666f\u8272\u3092\u8a2d\u5b9a\uff08\u9ad8\u901f\u30fb\u5b89\u5168\u7248\uff09 *\/<\/p>\n<p>function colorCellsByNoteContent() {<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const props = PropertiesService.getDocumentProperties();<\/p>\n<p>\/\/ \u25bc \u76f4\u524d\u306e\u30cf\u30a4\u30e9\u30a4\u30c8\u3060\u3051\u89e3\u9664\uff08\u65e2\u5b58\u306e\u914d\u8272\u30fb\u6761\u4ef6\u4ed8\u304d\u66f8\u5f0f\u306f\u4fdd\u6301\uff09<\/p>\n<p>clearLastNoteColoring();<\/p>\n<p>\/\/ \u25bc \u30b7\u30fc\u30c8\u5168\u4f53\uff08\u7a7a\u30bb\u30eb\u306e\u30e1\u30e2\u3082\u5bfe\u8c61\uff09\u3092\u4e00\u62ec\u53d6\u5f97<\/p>\n<p>const rows = sheet.getMaxRows();<\/p>\n<p>const cols = sheet.getMaxColumns();<\/p>\n<p>if (!rows || !cols) return;<\/p>\n<p>const rng \u00a0 = sheet.getRange(1, 1, rows, cols);<\/p>\n<p>const notes = rng.getNotes(); \/\/ 2\u6b21\u5143\u914d\u5217<\/p>\n<p>\/\/ \u30eb\u30fc\u30eb\u3054\u3068\u306b A1 \u4e00\u89a7\u3092\u30d0\u30b1\u30c3\u30c8\u5316<\/p>\n<p>const buckets = Object.fromEntries(Object.keys(NOTE_COLOR_RULES).map(k =&gt; [k, []]));<\/p>\n<p>for (let r = 0; r &lt; rows; r++) {<\/p>\n<p>for (let c = 0; c &lt; cols; c++) {<\/p>\n<p>const note = notes[r][c];<\/p>\n<p>if (!note) continue;<\/p>\n<p>for (const [kw, color] of Object.entries(NOTE_COLOR_RULES)) {<\/p>\n<p>if (note.indexOf(kw) !== -1) { \/\/ \u5927\u6587\u5b57\u5c0f\u6587\u5b57\u533a\u5225\u304c\u4e0d\u8981\u306a\u3089 toLowerCase() \u3057\u3066\u6bd4\u8f03<\/p>\n<p>buckets[kw].push(toA1(r + 1, c + 1));<\/p>\n<p>break; \/\/ \u6700\u521d\u306b\u30de\u30c3\u30c1\u3057\u305f\u30eb\u30fc\u30eb\u3067\u78ba\u5b9a}}}}<\/p>\n<p>\/\/ \u25bc \u5bfe\u8c61\u30bb\u30eb\u3060\u3051\u3092\u7740\u8272\uff08\u5168\u4f53\u30ea\u30bb\u30c3\u30c8\u306f\u3057\u306a\u3044\uff09<\/p>\n<p>const applied = [];<\/p>\n<p>for (const [kw, a1s] of Object.entries(buckets)) {<\/p>\n<p>if (a1s.length) {<\/p>\n<p>sheet.getRangeList(a1s).setBackground(NOTE_COLOR_RULES[kw]);<\/p>\n<p>applied.push(&#8230;a1s);}}<\/p>\n<p>\/\/ \u4eca\u56de\u9069\u7528\u3057\u305f\u30bb\u30eb\u3092\u8a18\u9332\uff08\u6b21\u56de\u306e\u89e3\u9664\u7528\uff09<\/p>\n<p>props.setProperty(&#8216;prevHighlighted&#8217;, JSON.stringify(applied));}<\/p>\n<p>\/** \u76f4\u524d\u306e\u8272\u5206\u3051\u3060\u3051\u3092\u89e3\u9664\uff08\u5168\u4f53\u306f\u89e6\u3089\u306a\u3044\uff09 *\/<\/p>\n<p>function clearLastNoteColoring() {<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const props = PropertiesService.getDocumentProperties();<\/p>\n<p>const prev = JSON.parse(props.getProperty(&#8216;prevHighlighted&#8217;) || &#8216;[]&#8217;);<\/p>\n<p>if (prev.length) {<\/p>\n<p>sheet.getRangeList(prev).setBackground(null);<\/p>\n<p>props.deleteProperty(&#8216;prevHighlighted&#8217;);}}<\/p>\n<p>\/** \u5217\u756a\u53f7\u2192A1\u8a18\u6cd5\uff081\u2192A, 27\u2192AA\uff09 *\/<\/p>\n<p>function toA1(row, col) {<\/p>\n<p>let s = &#8221;;<\/p>\n<p>while (col &gt; 0) {<\/p>\n<p>const m = (col &#8211; 1) % 26;<\/p>\n<p>s = String.fromCharCode(65 + m) + s;<\/p>\n<p>col = (col &#8211; 1 &#8211; m) \/ 26;}<\/p>\n<p>return s + row;}<\/p>\n<h3>\u30e1\u30e2\u306e\u5185\u5bb9\u3092\u81ea\u52d5\u3067\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u8868\u793a<\/h3>\n<p><span style=\"background-color: #ffff99;\"><b>\u7279\u5b9a\u306e\u30bb\u30eb\u304c\u9078\u629e\u3055\u308c\u305f\u969b\u306b\u3001\u30e1\u30e2\u306e\u5185\u5bb9\u3092\u81ea\u52d5\u7684\u306b\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u8868\u793a\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/b><\/span>\u3053\u308c\u306b\u3088\u308a\u3001\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u3057\u306a\u304f\u3066\u3082\u30e1\u30e2\u5185\u5bb9\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\/** ================================<\/p>\n<p>* \u30e1\u30e2\u306e\u5b89\u5168\u8868\u793a\uff06\u30e1\u30cb\u30e5\u30fc\u8ffd\u52a0\uff08\u4e38\u3054\u3068\u5dee\u3057\u66ff\u3048\uff09<\/p>\n<p>* ================================ *\/<\/p>\n<p>\/** HTML\u57cb\u3081\u8fbc\u307f\u7528\u306e\u7c21\u6613\u30a8\u30b9\u30b1\u30fc\u30d7 *\/<\/p>\n<p>function _esc(s) {<\/p>\n<p>return String(s ?? &#8221;).replace(\/[&amp;&lt;&gt;&#8221;&#8216;]\/g, m =&gt; (<\/p>\n<p>{ &#8216;&amp;&#8217;:&#8217;&amp;amp;&#8217;, &#8216;&lt;&#8216;:&#8217;&amp;lt;&#8217;, &#8216;&gt;&#8217;:&#8217;&amp;gt;&#8217;, &#8216;&#8221;&#8216;:&#8217;&amp;quot;&#8217;, &#8220;&#8216;&#8221;:&#8217;&amp;#39;&#8217; }[m]));}<\/p>\n<p>\/** \u9078\u629e\u30bb\u30eb\u306e\u30e1\u30e2\u3092\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u8868\u793a\uff08XSS\u5bfe\u7b56\u6e08\u307f\uff09 *\/<\/p>\n<p>function showNotePopup() {<\/p>\n<p>const sheet = SpreadsheetApp.getActiveSheet();<\/p>\n<p>const cell\u00a0 = sheet.getActiveCell();<\/p>\n<p>if (!cell) {<\/p>\n<p>SpreadsheetApp.getUi().alert(&#8216;\u30bb\u30eb\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002&#8217;);<\/p>\n<p>return;}<\/p>\n<p>const note = cell.getNote();<\/p>\n<p>if (!note) {<\/p>\n<p>SpreadsheetApp.getUi().alert(&#8216;\u3053\u306e\u30bb\u30eb\u306b\u306f\u30e1\u30e2\u304c\u3042\u308a\u307e\u305b\u3093\u3002&#8217;);<\/p>\n<p>return;}<\/p>\n<p>const cellAddress = cell.getA1Notation();<\/p>\n<p>const html = HtmlService.createHtmlOutput(<\/p>\n<p>`&lt;!doctype html&gt;&lt;meta charset=&#8221;utf-8&#8243;&gt;<\/p>\n<p>&lt;div style=&#8221;font-family:system-ui, Arial, sans-serif;&#8221;&gt;<\/p>\n<p>&lt;h3 style=&#8221;color:#333; margin:0 0 8px;&#8221;&gt;\u30bb\u30eb ${_esc(cellAddress)} \u306e\u30e1\u30e2&lt;\/h3&gt;<\/p>\n<p>&lt;div style=&#8221;<\/p>\n<p>background:#FFFACD;<\/p>\n<p>padding:15px;<\/p>\n<p>border-radius:8px;<\/p>\n<p>margin:10px 0;<\/p>\n<p>white-space:pre-wrap;<\/p>\n<p>word-wrap:break-word;<\/p>\n<p>&#8220;&gt;${_esc(note)}&lt;\/div&gt;<\/p>\n<p>&lt;\/div&gt;`<\/p>\n<p>).setWidth(420).setHeight(300);<\/p>\n<p>SpreadsheetApp.getUi().showModalDialog(html, &#8216;\u30e1\u30e2\u5185\u5bb9&#8217;);}<\/p>\n<p>\/** \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u958b\u3044\u305f\u3089\u30ab\u30b9\u30bf\u30e0\u30e1\u30cb\u30e5\u30fc\u3092\u81ea\u52d5\u8ffd\u52a0 *\/<\/p>\n<p>function onOpen() {<\/p>\n<p>SpreadsheetApp.getUi()<\/p>\n<p>.createMenu(&#8216;\u30e1\u30e2\u30c4\u30fc\u30eb&#8217;)<\/p>\n<p>.addItem(&#8216;\u9078\u629e\u30bb\u30eb\u306e\u30e1\u30e2\u3092\u8868\u793a&#8217;, &#8216;showNotePopup&#8217;)<\/p>\n<p>.addItem(&#8216;\u30e1\u30e2\u3092\u8272\u5206\u3051&#8217;, &#8216;colorCellsByNoteContent&#8217;)\u00a0 \u00a0\/\/ \u65e2\u5b58\u306e\u95a2\u6570\u304c\u5225\u9014\u3042\u308b\u60f3\u5b9a<\/p>\n<p>.addItem(&#8216;\u30e1\u30e2\u4e00\u89a7\u3092\u51fa\u529b&#8217;, &#8216;exportAllNotesToNewSheet&#8217;)\u00a0 \/\/ \u65e2\u5b58\u306e\u95a2\u6570\u304c\u5225\u9014\u3042\u308b\u60f3\u5b9a<\/p>\n<p>.addSeparator()<\/p>\n<p>.addItem(&#8216;\u30e1\u30e2\u3092\u691c\u7d22&#8217;, &#8216;searchNotesWithKeyword&#8217;)\u00a0 \u00a0\/\/ \u65e2\u5b58\u306e\u95a2\u6570\u304c\u5225\u9014\u3042\u308b\u60f3\u5b9a<\/p>\n<p>.addToUi();}<\/p>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30e1\u30e2\u3092\u5e38\u306b\u8868\u793a\u3059\u308b\u306b\u306fGAS\u3092\u6d3b\u7528<\/h2>\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306f\u6a19\u6e96\u6a5f\u80fd\u3060\u3051\u3067\u306f\u30e1\u30e2\u306e\u5e38\u6642\u8868\u793a\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u30b3\u30e1\u30f3\u30c8\u5207\u66ff\u30fb\u5c02\u7528\u5217\u30fb\u63cf\u753b\u30c6\u30ad\u30b9\u30c8\u3068\u3044\u3063\u305f\u4ee3\u66ff\u624b\u6bb5\u306b\u52a0\u3048\u3001GAS\u306e\u30b5\u30a4\u30c9\u30d0\u30fc\u8868\u793a\u3084\u4e00\u89a7\u51fa\u529b\u3092\u7d44\u307f\u5408\u308f\u305b\u308c\u3070\u3001\u5b9f\u8cea\u7684\u306a\u201c\u5e38\u6642\u53ef\u8996\u5316\u201d\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u91cd\u8981\u5ea6\u3067\u8272\u5206\u3051\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u691c\u7d22\u3001\u9078\u629e\u30bb\u30eb\u306e\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u306a\u3069\u3092\u52a0\u3048\u308b\u3068\u3001\u898b\u843d\u3068\u3057\u3092\u9632\u304e\u3064\u3064\u904b\u7528\u52b9\u7387\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<p>\u672c\u8a18\u4e8b\u3067\u7d39\u4ecb\u3057\u305fGAS\u30b3\u30fc\u30c9\u3092\u57fa\u306b\u3001\u30c1\u30fc\u30e0\u306e\u30cb\u30fc\u30ba\u306b\u5408\u308f\u305b\u305f\u72ec\u81ea\u306e\u30e1\u30e2\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3057\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3067\u306e\u4f5c\u696d\u52b9\u7387\u3092\u6700\u5927\u5316\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\uff08Google Sheets\uff09\u306e\u30e1\u30e2\u6a5f\u80fd\u306f\u3001\u30bb\u30eb\u306b\u88dc\u8db3\u60c5\u5831\u3092\u8ffd\u52a0\u3067\u304d\u308b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u3067\u3059\u304c\u3001\u901a\u5e38\u306f\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u6642\u306e\u307f\u8868\u793a\u3055\u308c\u308b\u305f\u3081\u3001\u91cd\u8981\u306a\u60c5\u5831\u3092\u898b\u9003\u3057\u304c\u3061\u3067\u3059\u3002 \u672c\u8a18\u4e8b\u3067\u306f\u3001\u30e1\u30e2\u3092\u5e38\u6642\u8868\u793a\u3055\u305b [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[51],"tags":[],"class_list":["post-21128","post","type-post","status-publish","format-standard","hentry","category-excel"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/posts\/21128","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/comments?post=21128"}],"version-history":[{"count":16,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/posts\/21128\/revisions"}],"predecessor-version":[{"id":21411,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/posts\/21128\/revisions\/21411"}],"wp:attachment":[{"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/media?parent=21128"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/categories?post=21128"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/biz.moneyforward.com\/work-efficiency\/basic\/wp-json\/wp\/v2\/tags?post=21128"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}