質問編集履歴
3
動画をアップしました
title
CHANGED
File without changes
|
body
CHANGED
@@ -14,6 +14,8 @@
|
|
14
14
|
こちらのページを参照にしています
|
15
15
|
|
16
16
|
https://tonari-it.com/gas-if/
|
17
|
+
動画でやりたいことを説明しています
|
18
|
+
https://youtu.be/s39c1KRHtQ0
|
17
19
|
|
18
20
|
```Google Apps Script
|
19
21
|
|
2
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,18 +1,31 @@
|
|
1
1
|
googleスプレッドシートで下記のGAScodeを組んでいます
|
2
|
+
スプレッドシートのA1~A10のセルに
|
3
|
+
A1セル
|
4
|
+
りんご/
|
5
|
+
みかん/
|
6
|
+
いちご/
|
7
|
+
バナナ/
|
2
|
-
|
8
|
+
上記のように1つのセルに改行されて文字が入力されています。
|
3
|
-
B1
|
9
|
+
B1に関数のSPLIT = SPLIT(A1,"/")を入れています。この内容をB2行目からB10行目までfor文でだしたいのですが
|
4
10
|
consoleの書き込み方法まではわかったのですが
|
5
|
-
直接B
|
11
|
+
直接B行への書き込み方がわかりません。
|
6
12
|
だれか教えていただければと思います
|
7
13
|
|
8
14
|
こちらのページを参照にしています
|
15
|
+
|
9
16
|
https://tonari-it.com/gas-if/
|
17
|
+
|
10
18
|
```Google Apps Script
|
19
|
+
|
11
20
|
function myFunction() {
|
12
|
-
const sheet = SpreadsheetApp.getActiveSheet();
|
21
|
+
const sheet = SpreadsheetApp.getActiveSheet();
|
13
22
|
const lastRow = sheet.getLastRow();
|
23
|
+
|
14
24
|
for(let i = 2; i <= lastRow; i++) {
|
25
|
+
if(!sheet.getRange(i, 2).getValue()){
|
15
|
-
|
26
|
+
console.log(sheet.getRange(i, 1).getValue());
|
27
|
+
}
|
16
28
|
}
|
17
29
|
}
|
30
|
+
|
18
31
|
```
|
1
title
CHANGED
File without changes
|
body
CHANGED
File without changes
|