質問編集履歴

3

動画をアップしました

2020/11/13 04:53

投稿

nobinomio
nobinomio

スコア43

test CHANGED
File without changes
test CHANGED
@@ -30,6 +30,10 @@
30
30
 
31
31
  https://tonari-it.com/gas-if/
32
32
 
33
+ 動画でやりたいことを説明しています
34
+
35
+ https://youtu.be/s39c1KRHtQ0
36
+
33
37
 
34
38
 
35
39
  ```Google Apps Script

2

2020/11/13 04:53

投稿

nobinomio
nobinomio

スコア43

test CHANGED
File without changes
test CHANGED
@@ -1,12 +1,24 @@
1
1
  googleスプレッドシートで下記のGAScodeを組んでいます
2
2
 
3
- スプレッドシートのA1~A99まで数字が入力されています。
3
+ スプレッドシートのA1~A10のセルに
4
4
 
5
+ A1セル
6
+
7
+ りんご/
8
+
9
+ みかん/
10
+
11
+ いちご/
12
+
13
+ バナナ/
14
+
5
- B1からA列内容をforでだしたので
15
+ 上記のように1セルに改行されて字が入力されて
16
+
17
+ B1に関数のSPLIT = SPLIT(A1,"/")を入れています。この内容をB2行目からB10行目までfor文でだしたいのですが
6
18
 
7
19
  consoleの書き込み方法まではわかったのですが
8
20
 
9
- 直接Bへの書き込み方がわかりません。
21
+ 直接Bへの書き込み方がわかりません。
10
22
 
11
23
  だれか教えていただければと思います
12
24
 
@@ -14,22 +26,36 @@
14
26
 
15
27
  こちらのページを参照にしています
16
28
 
29
+
30
+
17
31
  https://tonari-it.com/gas-if/
32
+
33
+
18
34
 
19
35
  ```Google Apps Script
20
36
 
37
+
38
+
21
39
  function myFunction() {
22
40
 
23
- const sheet = SpreadsheetApp.getActiveSheet();
41
+ const sheet = SpreadsheetApp.getActiveSheet();
24
42
 
25
43
  const lastRow = sheet.getLastRow();
26
44
 
45
+
46
+
27
47
  for(let i = 2; i <= lastRow; i++) {
28
48
 
49
+ if(!sheet.getRange(i, 2).getValue()){
50
+
29
- console.log(sheet.getRange(i, 1).getValue());
51
+ console.log(sheet.getRange(i, 1).getValue());
52
+
53
+ }
30
54
 
31
55
  }
32
56
 
33
57
  }
34
58
 
59
+
60
+
35
61
  ```

1

2020/11/13 00:04

投稿

nobinomio
nobinomio

スコア43

test CHANGED
File without changes
test CHANGED
File without changes