{"id":655,"date":"2020-03-20T23:55:45","date_gmt":"2020-03-20T14:55:45","guid":{"rendered":"https:\/\/auto-worker.com\/blog\/?p=655"},"modified":"2020-07-25T13:32:48","modified_gmt":"2020-07-25T04:32:48","slug":"post-655","status":"publish","type":"post","link":"https:\/\/auto-worker.com\/blog\/?p=655","title":{"rendered":"Google Apps Script(GAS)\u5165\u9580 \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u53d6\u5f97\u30fb\u66f8\u304d\u8fbc\u307f\u65b9\u6cd5(getValue,setValue)"},"content":{"rendered":"<p>Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306e\u6570\u5024\u30fb\u6587\u5b57\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3068\u3001GAS\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u51e6\u7406\u3057\u305f\u5024\u3092\u30bb\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>GAS\u306b\u3088\u308b\u69d8\u3005\u306a\u30bb\u30eb\u306e\u5024\u306e\u53d6\u5f97\u65b9\u6cd5\u3068\u66f8\u304d\u8fbc\u307f\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3068\u30b7\u30fc\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u65b9\u6cd5<\/h2>\n<p>Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u3084\u66f8\u304d\u8fbc\u3080\u305f\u3081\u306b\u306f\u3001\u4e8b\u524d\u306b\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3068\u30b7\u30fc\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>GAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\uff0b\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5\u306b\u3064\u3044\u3066\u3001\u305d\u308c\u305e\u308c\u4e0b\u8a18\u306e\u8a18\u4e8b\u3067\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>Google Apps Script\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5<\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"U2CNoFYZIp\"><p><a href=\"https:\/\/auto-worker.com\/blog\/?p=607\">Google Apps Script(GAS)\u5165\u9580 \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\u30fb\u8aad\u307f\u8fbc\u30803\u7a2e\u985e\u306e\u65b9\u6cd5\u3092\u89e3\u8aac<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Google Apps Script(GAS)\u5165\u9580 \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u53d6\u5f97\u30fb\u8aad\u307f\u8fbc\u30803\u7a2e\u985e\u306e\u65b9\u6cd5\u3092\u89e3\u8aac&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=607&#038;embed=true#?secret=2H0LSE0S7l#?secret=U2CNoFYZIp\" data-secret=\"U2CNoFYZIp\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<h3>Google Apps Script\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5<\/h3>\n<blockquote class=\"wp-embedded-content\" data-secret=\"K0CTu4b51o\"><p><a href=\"https:\/\/auto-worker.com\/blog\/?p=640\">Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u65b9\u6cd5&#8221; &#8212; AutoWorker\u301cGoogle Apps Script(GAS)\u3068Sikuli\u3067\u59cb\u3081\u308b\u696d\u52d9\u6539\u5584\u5165\u9580\" src=\"https:\/\/auto-worker.com\/blog\/?p=640&#038;embed=true#?secret=nx8MBoU2LB#?secret=K0CTu4b51o\" data-secret=\"K0CTu4b51o\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>\u307e\u305a\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u307f\u3001\u3055\u3089\u306b\u53d6\u5f97\u3057\u305f\u3044\u30bb\u30eb\u304c\u3042\u308b\u30b7\u30fc\u30c8\u306e\u8aad\u307f\u8fbc\u307f\u304c\u4e8b\u524d\u6e96\u5099\u3068\u3057\u3066\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f7f\u3063\u3066\u8aac\u660e\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-663\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_006.jpg\" alt=\"Google Apps Script(GAS)\u3067\u30bb\u30eb\u3092\u53d6\u5f97\u30fb\u66f8\u304d\u8fbc\u3080\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\" width=\"600\" height=\"361\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_006.jpg 600w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_006-300x181.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_006-530x319.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_006-565x340.jpg 565w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u306b\u3042\u308b\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u30fb\u66f8\u304d\u8fbc\u3080\u524d\u306b\u3001\u5bfe\u8c61\u306e\u30bb\u30eb\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30bb\u30eb\u306e\u7bc4\u56f2\u6307\u5b9a\u3059\u308b\u305f\u3081\u306b\u306f\u3001sheet\u30af\u30e9\u30b9\u3067\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308bgetRange()\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>GAS\u306egetRange\u30e1\u30bd\u30c3\u30c9\u306b\u306f\u5f15\u6570\u306e\u6307\u5b9a\u65b9\u6cd5\u304c4\u7a2e\u985e\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>getRange(Integer row, Integer column)<\/li>\n<li>getRange(Integer row, Integer column, Integer numRows)<\/li>\n<li>getRange(Integer row, Integer column, Integer numRows, Integer numColumns)<\/li>\n<li>getRange(String a1Notation)<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-658\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_001.jpg\" alt=\"\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3059\u308b\u30e1\u30bd\u30c3\u30c9getRange\u306e\u5f15\u6570\u306f4\u7a2e\u985e\" width=\"600\" height=\"102\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_001.jpg 600w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_001-300x51.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_001-530x90.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_001-565x96.jpg 565w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>\u2460getRange(Integer row, Integer column)<\/h3>\n<p>1\u3064\u76ee\u306egetRange(Integer row, Integer column)\u306f\u3001\uff12\u3064\u306e\u5f15\u6570\u3092\u6307\u5b9a\u3057\u3001\u5909\u6570row:\u884c\u756a\u53f7\u3068\u5909\u6570column\uff1a\u5217\u756a\u53f7\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>sheet.getRange(2, 1)<\/code><\/p>\n<p>2\u884c\u76ee\u306e1\u5217\u76ee\u306e\u30bb\u30eb(A2\u30bb\u30eb)\u30921\u3064\u6307\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-659\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_002.jpg\" alt=\"Google Apps Script(GAS)\u306e\u30e1\u30bd\u30c3\u30c9getRange\u306b2\u3064\u306e\u5f15\u6570\u3067\u5358\u4e00\u306e\u30bb\u30eb\u3092\u6307\u5b9a\" width=\"451\" height=\"284\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_002.jpg 451w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_002-300x189.jpg 300w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u306f\u5358\u4e00\u306e\u30bb\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u2461getRange(Integer row, Integer column, Integer numRows)<\/h3>\n<p>getRange(Integer row, Integer column, Integer numRows)\u3067\u306f\u3001\u2460\u3064\u76ee\u306egetRange\u306bnumRows\u3068\u3044\u3046\u5f15\u6570\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>row\u3068column\u306b\u52a0\u3048\u3001\u5909\u6570numRows:\u884c\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>sheet.getRange(2, 1, 5)<\/code><\/p>\n<p>2\u884c1\u5217\u76ee\u304b\u30896\u884c1\u5217\u76ee(A2:6\u30bb\u30eb)\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-660\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_003.jpg\" alt=\"Google Apps Script(GAS)\u306e\u30e1\u30bd\u30c3\u30c9getRange\u306b3\u3064\u306e\u5f15\u6570\u3067\u8907\u6570\u306e\u30bb\u30eb\u3092\u7bc4\u56f2\u6307\u5b9a\" width=\"453\" height=\"286\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_003.jpg 453w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_003-300x189.jpg 300w\" sizes=\"auto, (max-width: 453px) 100vw, 453px\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u306f\u8907\u6570\u306e\u30bb\u30eb\u7bc4\u56f2\u304c\u6307\u5b9a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u2462getRange(Integer row, Integer column, Integer numRows, Integer numColumns)<\/h3>\n<p>3\u3064\u76ee\u306f\u3055\u3089\u306bnumColumns\u3068\u3044\u3046\u5f15\u6570\u304c\u8ffd\u52a0\u3055\u308c\u3001\u5217\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>sheet.getRange(3, 2, 5, 3)<\/code><\/p>\n<p>3\u884c2\u5217\u76ee\u304b\u30897\u884c8\u5217\u76ee(A2:C6\u30bb\u30eb)\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u8868\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-661\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_004.jpg\" alt=\"Google Apps Script(GAS)\u306e\u30e1\u30bd\u30c3\u30c9getRange\u306b4\u3064\u306e\u5f15\u6570\u3067\u8907\u6570\u306e\u30bb\u30eb\u3092\u7bc4\u56f2\u6307\u5b9a\" width=\"454\" height=\"283\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_004.jpg 454w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_004-300x187.jpg 300w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u3082\u8907\u6570\u306e\u7bc4\u56f2\u304c\u6307\u5b9a\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u2463getRange(String a1Notation)<\/h3>\n<p>\u6700\u5f8c\u306egetRange\u30e1\u30bd\u30c3\u30c9\u306f\u5f15\u6570\u306e\u30bf\u30a4\u30d7\u304cString\u578b\u3068\u3001\u4eca\u307e\u3067\u306eInteger\u578b\u3068\u7570\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>R1C1\u5f62\u5f0f\u306f\u30bb\u30eb\u53c2\u7167\u306e\u65b9\u5f0f\u306e1\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>R1C1=1\u884c1\u5217<\/li>\n<li>R2C3=2\u884c3\u5217<\/li>\n<\/ul>\n<p>\u4e0a\u8a18\u306e\u3088\u3046\u306a\u300cR*C*\u300d\u3068\u3044\u3046\u5f62\u5f0f\u306e\u6587\u5b57\u5217\u3067\u5f15\u6570\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><code>sheet.getRange(\"R3C2\")<\/code><\/p>\n<p>\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u306f\u3001\u2460\u3068\u540c\u30583B\u30bb\u30eb\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30bb\u30eb\u3092\u6307\u5b9a\u3059\u308b\u969b\u306b\u306f\u2460\u304b\u3089\u2463\u306e\u3069\u308c\u3092\u5229\u7528\u3057\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001Integer\u578b\u306e\u5909\u6570\u3092\u5f15\u6570\u306b\u3059\u308b\u2460\uff5e\u2462\u304c\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u4f7f\u3044\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<h2>GAS\u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30e1\u30bd\u30c3\u30c9<\/h2>\n<p>getRange\u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u306b\u306f<strong>getValue<\/strong>\u3068\u3001<strong>getValue<span style=\"color: #ff0000;\">s<\/span><\/strong>\u306e2\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5358\u4e00\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3059\u308bgetValue\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>1\u3064\u76ee\u306egetValue\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u8aad\u307f\u8fbc\u3093\u3060\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u6307\u5b9a\u3057\u305f\u30b7\u30fc\u30c8\u306b\u3042\u308b\u5358\u4e00\u306e\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><code>let data = sheet.getRange(3, 2).getValue();<br \/>\nLogger.log(data);<\/code><\/p>\n<p>\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u5834\u5408\u30013B\u30bb\u30eb\u306b\u6307\u5b9a\u3055\u308c\u305f\u5024\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-662\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_005.jpg\" alt=\"Google Apps Script(GAS)\u306egetValue\u30e1\u30bd\u30c3\u30c9\u3067\u53d6\u5f97\u3057\u305f\u5024\u3092\u30ed\u30b0\u51fa\u529b\u3059\u308b\" width=\"247\" height=\"97\" \/><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b<\/p>\n<p>\u2461\u3084\u2462\u306e\u3088\u3046\u306a\u8907\u6570\u306e\u30bb\u30eb\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u305fgetRange\u306e\u5834\u5408\u306f\u3001\u6700\u521d\u306e\u30bb\u30eb\u306e\u5024\u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3059\u3002<\/p>\n<p>\u53d6\u5f97\u3057\u305f\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u5909\u6570\u306e\u578b\u304c\u81ea\u52d5\u7684\u306b\u5909\u5316\u3057\u3001\u6570\u5024\u306e\u5834\u5408\u306fNumber\u578b\u3001\u6587\u5b57\u5217\u306e\u5834\u5408\u306fString\u578b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u8907\u6570\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3059\u308bgetValues\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>\u5148\u7a0b\u306egetValue\u306f1\u3064\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3057\u307e\u3057\u305f\u304c\u3001getValues\u306f\u8907\u6570\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n<p>\u7bc4\u56f2\u6307\u5b9a\u3057\u305f\u8907\u6570\u30bb\u30eb\u306e\u5024\u30922\u6b21\u5143\u914d\u5217\u3067\u683c\u7d0d\u3057\u307e\u3059\u3002<\/p>\n<p><code>let data = sheet.getRange(2, 2, 5, 3).getValues();<br \/>\nLogger.log(data);<\/code><\/p>\n<p>\u4eca\u56de\u306e\u5b9f\u884c\u7d50\u679c\u3067\u306f\u30015\u27153\u306e2\u6b21\u5143\u914d\u5217data[0][0]\uff5edata[4][2]\u306b\u5024\u304c\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-664\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_007.jpg\" alt=\"Google Apps Script(GAS)\u306egetValues\u30e1\u30bd\u30c3\u30c9\u3067\u8907\u6570\u30bb\u30eb\u30922\u6b21\u5143\u914d\u5217\u3067\u53d6\u5f97\u3057\u3001\u30ed\u30b0\u51fa\u529b\" width=\"621\" height=\"128\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_007.jpg 621w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_007-300x62.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_007-530x109.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_007-565x116.jpg 565w\" sizes=\"auto, (max-width: 621px) 100vw, 621px\" \/><\/p>\n<p>\u306a\u304a\u3001\u5f15\u6570\u304c3\u3064\u306esheet.getRange(2, 2, 5)\u306e\u5834\u5408\u30821\u6b21\u5143\u914d\u5217\u3067\u306f\u306a\u304f\u30012\u6b21\u5143\u914d\u5217\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5834\u5408\u306f\u3001data[0][0]\uff5edata[4][0]\u3068\u3044\u30462\u6b21\u5143\u914d\u5217\u306b\u683c\u7d0d\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u5358\u4e00\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306fgetValue\u30e1\u30bd\u30c3\u30c9\u3001\u8907\u6570\u306e\u30bb\u30eb\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306fgetValues\u30e1\u30bd\u30c3\u30c9\u3067\u4f7f\u3044\u5206\u3051\u307e\u3059\u3002<\/p>\n<h2>\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3080\u30e1\u30bd\u30c3\u30c9<\/h2>\n<p>getRange\u3067\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306e\u5024\u3092\u66f8\u304d\u8fbc\u3080\u30e1\u30bd\u30c3\u30c9\u306b\u306fgetValue\u540c\u69d8\u306b\u3001<strong>setValue<\/strong>\u3068\u3001<strong>setValue<span style=\"color: #ff0000;\">s<\/span><\/strong>\u306e2\u7a2e\u985e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u5358\u4e00\u306e\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3080setValue(Object value)\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>1\u3064\u76ee\u306esetValue\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u7279\u5b9a\u306e1\u3064\u306e\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p><code>sheet.getRange(3, 2).setValue(150);<\/code><\/p>\n<p>\u3053\u306e\u5834\u5408\u3001B3\u30bb\u30eb\u306e\u6d88\u3057\u30b4\u30e0\u306e\u5024\u6bb5\u304c70\u2192150\u306b\u5909\u5316\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-665\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_008.jpg\" alt=\"Google Apps Script(GAS)\u306esetValue\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3080\" width=\"559\" height=\"339\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_008.jpg 559w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_008-300x182.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_008-530x321.jpg 530w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/p>\n<h3>\u8907\u6570\u306e\u30bb\u30eb\u306b\u5024\u3092\u66f8\u304d\u8fbc\u3080setValues(Object[][] value)\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p>2\u3064\u76ee\u306esetValues\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u8907\u6570\u306e\u30bb\u30eb\u306b\u5f15\u6570\u306b\u6307\u5b9a\u3057\u305f2\u6b21\u5143\u914d\u5217\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p><code>let data = [[100,10],[150,20],[200,30],[250,40],[300,50]];<br \/>\nsheet.getRange(3, 2, 5, 2).setValue(data);<\/code><\/p>\n<p>getRange\u30e1\u30bd\u30c3\u30c9\u3067\u8907\u6570\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u305f\u30bb\u30eb\u306b2\u6b21\u5143\u914d\u5217\u306e\u5024\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-666\" src=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_009.jpg\" alt=\"Google Apps Script(GAS)\u306esetValues\u30e1\u30bd\u30c3\u30c9\u3067\u8907\u6570\u30bb\u30eb\u306b2\u6b21\u5143\u914d\u5217\u306e\u5024\u3092\u66f8\u304d\u8fbc\u3080\" width=\"568\" height=\"325\" srcset=\"https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_009.jpg 568w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_009-300x172.jpg 300w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_009-530x303.jpg 530w, https:\/\/auto-worker.com\/blog\/wp-content\/uploads\/2020\/03\/20200320_auto_009-565x323.jpg 565w\" sizes=\"auto, (max-width: 568px) 100vw, 568px\" \/><\/p>\n<p>\u3053\u308c\u307e\u3067\u7d39\u4ecb\u3057\u305f\u901a\u308a\u3001\u66f8\u304d\u8fbc\u307f\u305f\u3044\u7bc4\u56f2\u306b\u5fdc\u3058\u30662\u7a2e\u985e\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u5206\u3051\u307e\u3059\u3002<\/p>\n<ol>\n<li>GAS\u3067\u30b7\u30fc\u30c8\u306e\u5358\u4e00\u30bb\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u5834\u5408\u306fsetValue(data)<\/li>\n<li>GAS\u3067\u30b7\u30fc\u30c8\u306e\u8907\u6570\u306e\u30bb\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u5834\u5408\u306fsetValues(data)<\/li>\n<\/ol>\n<h2>\u307e\u3068\u3081\u30fb\u7d42\u308f\u308a\u306b<\/h2>\n<p>\u4eca\u56de\u3001Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u306b\u3042\u308b\u30bb\u30eb\u306e\u5024\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3068\u66f8\u304d\u8fbc\u3080\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30b7\u30fc\u30c8\u3092\u8aad\u307f\u8fbc\u307f\u5f8c\u3001getRange\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30eb\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f8c\u3001getValue\u30fbgetValues\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30eb\u306e\u5024\u53d6\u5f97\u3001setValue\u30fbsetValues\u30e1\u30bd\u30c3\u30c9\u3067\u30bb\u30eb\u306b\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>\u30bb\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u30fb\u66f8\u304d\u8fbc\u307f\u306fGAS\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u64cd\u4f5c\u3059\u308b\u4e0a\u3067\u5fc5\u8981\u4e0d\u53ef\u6b20\u306a\u51e6\u7406\u3067\u3059\u3002<\/p>\n<p>\u7279\u306b\u8907\u6570\u306e\u30bb\u30eb\u7bc4\u56f2\u3092\u8aad\u307f\u8fbc\u307f\uff0b\u66f8\u304d\u8fbc\u3080\u3001getValues\u3068setValues\u306fGAS\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3088\u304f\u4f7f\u3046\u306e\u3067\u3001\u305c\u3072\u30de\u30b9\u30bf\u30fc\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Apps Script(GAS)\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u306e\u6570\u5024\u30fb\u6587\u5b57\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3068\u3001GAS\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u51e6\u7406\u3057\u305f\u5024\u3092\u30bb\u30eb\u306b\u66f8\u304d\u8fbc\u3080\u65b9\u6cd5\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002 GAS\u306b\u3088\u308b\u69d8\u3005\u306a\u30bb\u30eb\u306e\u5024\u306e\u53d6\u5f97\u65b9\u6cd5\u3068\u66f8\u304d\u8fbc\u307f\u65b9\u6cd5 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":651,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[14,214,210,213,124,211,212,64,136,208,137,209],"class_list":["post-655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gas","tag-gas","tag-getrange","tag-getvalue","tag-getvalues","tag-googleappsscript","tag-setvalue","tag-setvalues","tag-64","tag-136","tag-208","tag-137","tag-209"],"_links":{"self":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=655"}],"version-history":[{"count":5,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/655\/revisions"}],"predecessor-version":[{"id":1304,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/655\/revisions\/1304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/651"}],"wp:attachment":[{"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/auto-worker.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}