{"id":83,"date":"2017-03-15T16:14:13","date_gmt":"2017-03-15T07:14:13","guid":{"rendered":"http:\/\/shinke1987.net\/?p=83"},"modified":"2018-10-31T22:40:13","modified_gmt":"2018-10-31T13:40:13","slug":"post-83","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=83","title":{"rendered":"Excel\u3067\u30b5\u30a4\u30c8\u304b\u3089\u60c5\u5831\u53d6\u5f97\u3002"},"content":{"rendered":"<h2>2018\u5e7410\u670831\u65e5\u8ffd\u8a18<\/h2>\n<p><span style=\"color: #ff0000;\">Windows10\u306b\u3057\u305f\u3089\u52d5\u304b\u306a\u304f\u306a\u3063\u305f\u3002<\/span><\/p>\n<h2>\u74b0\u5883<\/h2>\n<p>Windows 7 Professional 64bit<br \/>\nExcel 2016<\/p>\n<h2>\u74b0\u5883\u8a2d\u5b9a<\/h2>\n<p>VBA\u306e\u30a8\u30c7\u30a3\u30bf\u3092\u958b\u3044\u3066\u3001\u300c\u30c4\u30fc\u30eb\u300d\u2192\u300c\u53c2\u7167\u8a2d\u5b9a\u300d\u3067\u3001<br \/>\n<span class=\"bold-red\">Microsoft Internet Controls<br \/>\nMicrosoft HTML Object Library<\/span><br \/>\n\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u3002<\/p>\n<h2>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h2>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nSub getTest() \r\n  Dim ie As InternetExplorer \r\n   \r\n  Set ie = CreateObject(&quot;internetexplorer.application&quot;) \r\n  ie.Visible = True \r\n  ie.Navigate (&quot;http:\/\/gameinfo.na.leagueoflegends.com\/en\/game-info\/champions\/amumu\/&quot;) \r\n  Do While ie.Busy Or ie.ReadyState &lt; READYSTATE_COMPLETE \r\n    DoEvents \r\n  Loop \r\n   \r\n  Call makeList(ie) \r\n   \r\n  ie.Quit \r\n   \r\nEnd Sub \r\n \r\nPublic Sub makeList(ObjIE As InternetExplorer) \r\n  Dim n As Long ' \u5168\u3066\u306e\u30bf\u30b0\u306e\u901a\u3057\u756a\u53f7 \r\n  Dim r As Long ' \u6307\u5b9a\u3057\u305f\u30bf\u30b0\u306e\u901a\u3057\u756a\u53f7 \r\n  Dim Doc As HTMLDocument ' html\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 \r\n  Dim ObjTD As IHTMLElementCollection \r\n  Dim ObjTag As Object \r\n  n = 0 \r\n  r = 0 \r\n  Sheets(&quot;sheet1&quot;).Select \r\n  Cells.ClearContents \r\n   \r\n  Cells.NumberFormatLocal = &quot;G\/\u6a19\u6e96&quot; \r\n  Set Doc = ObjIE.Document \r\n  ' \r\n  '  For n = 0 To Doc.all.Length - 1 \r\n  '    With Doc.all(n) \r\n  '      Debug.Print (&quot;!&quot;) \r\n  '      If .tagName = &quot;H1&quot; Then \r\n  '        Debug.Print (&quot;hit!&quot;) \r\n  '        r = r + 1 \r\n  '        Cells(r + 1, 1) = .tagName \r\n  '        Cells(r + 1, 2) = n \r\n  '        Cells(r + 1, 3) = r \r\n  '        Cells(r + 1, 4) = .innerText \r\n  '        MsgBox (.innerText) \r\n  '      End If \r\n  '    End With \r\n  '  Next \r\n   \r\n  Set ObjTD = Doc.getElementsByTagName(&quot;h1&quot;) \r\n  Debug.Print (ObjTD.Length) \r\n  For Each ObjTag In ObjTD \r\n    r = r + 1 \r\n    Cells(r, 1) = r \r\n    Cells(r, 2) = ObjTag.tagName \r\n    Cells(r, 3) = ObjTag.innerText \r\n  Next ObjTag \r\n   \r\n   \r\n   \r\n  Cells.EntireColumn.AutoFit \r\n  Cells.EntireRow.AutoFit \r\nEnd Sub \r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>2018\u5e7410\u670831\u65e5\u8ffd\u8a18 Windows10\u306b\u3057\u305f\u3089\u52d5\u304b\u306a\u304f\u306a\u3063\u305f\u3002 \u74b0\u5883 Windows 7 Professional 64bit Excel 2016 \u74b0\u5883\u8a2d\u5b9a VBA\u306e\u30a8\u30c7\u30a3\u30bf\u3092\u958b\u3044\u3066\u3001\u300c\u30c4\u30fc\u30eb\u300d\u2192\u300c\u53c2\u7167\u8a2d\u5b9a\u300d\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[22,23],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-excel","tag-excel","tag-23"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/83","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=83"}],"version-history":[{"count":2,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":468,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/83\/revisions\/468"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}