質問編集履歴

3

修正

2019/06/02 09:28

投稿

m.harada
m.harada

スコア10

test CHANGED
File without changes
test CHANGED
@@ -388,9 +388,9 @@
388
388
 
389
389
  コード内のコメントだけでなんとなく流れを把握してる状態です。
390
390
 
391
- 試した事は
391
+ 試した事は
392
-
392
+
393
- '⑤表示されたページから必要な情報を収集
393
+ ```'⑤表示されたページから必要な情報を収集
394
394
 
395
395
  Set txtInput(7) = objIE(0).document.getElementsByClassName("small")(0)
396
396
 
@@ -424,6 +424,8 @@
424
424
 
425
425
  End Sub
426
426
 
427
+ ```、
428
+
427
429
  ここの部分で検索結果をExcelに転記しているのかなと思い、URLに変えてやろうと思ったのですが検索結果のURLの部分のクラス名すら見つけれず。。
428
430
 
429
431
  そもそもこの部分ではないのでしょうか?付け加えるべきとこも分からないぐらい初心者です。

2

補足

2019/06/02 09:28

投稿

m.harada
m.harada

スコア10

test CHANGED
File without changes
test CHANGED
@@ -386,6 +386,48 @@
386
386
 
387
387
  初心者なので検索しながら色々試してみたのですが、検索結果のURLをどうExcelと紐づけて転記すればいいかわかりません。
388
388
 
389
+ コード内のコメントだけでなんとなく流れを把握してる状態です。
390
+
391
+ 試した事は、
392
+
393
+ '⑤表示されたページから必要な情報を収集
394
+
395
+ Set txtInput(7) = objIE(0).document.getElementsByClassName("small")(0)
396
+
397
+ Cells(i, 11).Value = txtInput(7).innerText
398
+
399
+ Cells(i, 11).Value = Replace(Replace(Cells(i, 11), "(", ""), ")", "")
400
+
401
+ Set txtInput(8) = objIE(0).document.getElementsByClassName("small")(1)
402
+
403
+ Cells(i, 13).Value = txtInput(8).innerText
404
+
405
+ Cells(i, 13).Value = Replace(Replace(Cells(i, 13), "(", ""), ")", "")
406
+
407
+ Set txtInput(9) = objIE(0).document.getElementsByClassName("small")(2)
408
+
409
+ Cells(i, 15).Value = txtInput(9).innerText
410
+
411
+ Cells(i, 15).Value = Replace(Replace(Cells(i, 15), "(", ""), ")", "")
412
+
413
+ Set txtInput(10) = objIE(0).document.getElementsByClassName("fare")(0)
414
+
415
+ Cells(i, 12).Value = txtInput(10).innerText
416
+
417
+ Set txtInput(11) = objIE(0).document.getElementsByClassName("fare")(1)
418
+
419
+ Cells(i, 14).Value = txtInput(11).innerText
420
+
421
+ Set txtInput(12) = objIE(0).document.getElementsByClassName("fare")(2)
422
+
423
+ Cells(i, 16).Value = txtInput(12).innerText
424
+
425
+ End Sub
426
+
427
+ ここの部分で検索結果をExcelに転記しているのかなと思い、URLに変えてやろうと思ったのですが検索結果のURLの部分のクラス名すら見つけれず。。
428
+
429
+ そもそもこの部分ではないのでしょうか?付け加えるべきとこも分からないぐらい初心者です。
430
+
389
431
  もしよろしければヒントでも良いので教えて頂けると嬉しいです。
390
432
 
391
433
 

1

誤字

2019/06/02 09:22

投稿

m.harada
m.harada

スコア10

test CHANGED
File without changes
test CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  http://henkan.tokyo/article/461532061.html
6
6
 
7
- 上記のサイトの 「【Excel VBA】「Yahoo路線情報」の乗り換え案内から、複数分の移動時間・運賃を一括検索する」 というVBAを丸々使わせて頂いてるのですが、検索結果の時間、料金に加えG列にその入力して出た検索結果のURLを転記したいです。
7
+ 上記のサイトの 「【Excel VBA】「Yahoo路線情報」の乗り換え案内から、複数分の移動時間・運賃を一括検索する」 というVBAを丸々使わせて頂いてるのですが、検索結果の時間、料金に加えQ列にその入力して出た検索結果のURLを転記したいです。
8
8
 
9
9
  ![イメージ説明](f115c1b37c06957608e94e06b275992a.png)
10
10