{"id":516,"date":"2025-02-08T00:33:35","date_gmt":"2025-02-07T15:33:35","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/02\/excel%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%b8%e3%81%ae%e9%81%93%ef%bc%9a%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%93%e9%80%a3\/"},"modified":"2025-02-08T00:33:35","modified_gmt":"2025-02-07T15:33:35","slug":"excel%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%b8%e3%81%ae%e9%81%93%ef%bc%9a%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%93%e9%80%a3","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/02\/excel%e3%83%9e%e3%82%b9%e3%82%bf%e3%83%bc%e3%81%b8%e3%81%ae%e9%81%93%ef%bc%9a%e4%b8%8a%e7%b4%9a%e8%80%85%e3%81%ae%e3%81%9f%e3%82%81%e3%81%ae%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e9%96%93%e9%80%a3\/","title":{"rendered":"Excel\u30de\u30b9\u30bf\u30fc\u3078\u306e\u9053\uff1a\u4e0a\u7d1a\u8005\u306e\u305f\u3081\u306e\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u30de\u30af\u30ed\u6d3b\u7528\u8853"},"content":{"rendered":"<h2>\u696d\u52d9\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u6975\u610f\uff01\u4e0a\u7d1a\u8005\u5411\u3051\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u30de\u30af\u30ed<\/h2>\n<h3>\u3059\u3050\u306b\u8a66\u305b\u308b\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u30b3\u30fc\u30c9<\/h3>\n<p>&#8220;`vba<br \/>\nSub \u8907\u6570\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u30de\u30af\u30ed()<br \/>\n    Dim ws As Worksheet<br \/>\n    Dim lastRow As Long<br \/>\n    Dim i As Long<\/p>\n<p>    Set ws = ThisWorkbook.Sheets(&#8220;\u30c7\u30fc\u30bf&#8221;)<br \/>\n    lastRow = ws.Cells(ws.Rows.Count, &#8220;A&#8221;).End(xlUp).Row<\/p>\n<p>    For i = 2 To lastRow<br \/>\n        &#8216; \u30b7\u30b9\u30c6\u30e0A\u304b\u3089\u30c7\u30fc\u30bf\u53d6\u5f97<br \/>\n        ws.Cells(i, &#8220;B&#8221;).Value = GetDataFromSystemA(ws.Cells(i, &#8220;A&#8221;).Value)<\/p>\n<p>        &#8216; \u30b7\u30b9\u30c6\u30e0B\u306b\u30c7\u30fc\u30bf\u9001\u4fe1<br \/>\n        SendDataToSystemB ws.Cells(i, &#8220;A&#8221;).Value, ws.Cells(i, &#8220;B&#8221;).Value<\/p>\n<p>        &#8216; \u30b7\u30b9\u30c6\u30e0C\u3067\u51e6\u7406\u5b9f\u884c<br \/>\n        ExecuteProcessInSystemC ws.Cells(i, &#8220;A&#8221;).Value<br \/>\n    Next i<br \/>\nEnd Sub<\/p>\n<p>Function GetDataFromSystemA(id As String) As String<br \/>\n    &#8216; \u30b7\u30b9\u30c6\u30e0A\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3053\u3053\u306b\u8a18\u8ff0<br \/>\n    &#8216; \u3053\u306e\u4f8b\u3067\u306f\u5358\u7d14\u306b\u6587\u5b57\u5217\u3092\u8fd4\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306fAPI\u547c\u3073\u51fa\u3057\u306a\u3069\u3092\u884c\u3044\u307e\u3059<br \/>\n    GetDataFromSystemA = &#8220;Data from System A for ID: &#8221; &#038; id<br \/>\nEnd Function<\/p>\n<p>Sub SendDataToSystemB(id As String, data As String)<br \/>\n    &#8216; \u30b7\u30b9\u30c6\u30e0B\u306b\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3053\u3053\u306b\u8a18\u8ff0<br \/>\n    &#8216; \u3053\u306e\u4f8b\u3067\u306f\u5358\u306b\u30c7\u30d0\u30c3\u30b0\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306fAPI\u547c\u3073\u51fa\u3057\u306a\u3069\u3092\u884c\u3044\u307e\u3059<br \/>\n    Debug.Print &#8220;Sending to System B: ID=&#8221; &#038; id &#038; &#8220;, Data=&#8221; &#038; data<br \/>\nEnd Sub<\/p>\n<p>Sub ExecuteProcessInSystemC(id As String)<br \/>\n    &#8216; \u30b7\u30b9\u30c6\u30e0C\u3067\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30fc\u30c9\u3092\u3053\u3053\u306b\u8a18\u8ff0<br \/>\n    &#8216; \u3053\u306e\u4f8b\u3067\u306f\u5358\u306b\u30c7\u30d0\u30c3\u30b0\u51fa\u529b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306fAPI\u547c\u3073\u51fa\u3057\u306a\u3069\u3092\u884c\u3044\u307e\u3059<br \/>\n    Debug.Print &#8220;Executing process in System C for ID: &#8221; &#038; id<br \/>\nEnd Sub<br \/>\n&#8220;`<\/p>\n<h3>1. \u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u306e\u91cd\u8981\u6027<\/h3>\n<p>Excel \u30de\u30af\u30ed\u3092\u6d3b\u7528\u3057\u305f\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u306f\u3001\u73fe\u4ee3\u306e\u30d3\u30b8\u30cd\u30b9\u74b0\u5883\u306b\u304a\u3044\u3066\u6b20\u304b\u305b\u306a\u3044\u6280\u8853\u3067\u3059\u3002\u8907\u6570\u306e\u30b7\u30b9\u30c6\u30e0\u3084\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304c\u5b58\u5728\u3059\u308b\u4f01\u696d\u3067\u306f\u3001\u3053\u308c\u3089\u3092\u52b9\u7387\u7684\u306b\u9023\u643a\u3055\u305b\u308b\u3053\u3068\u304c\u696d\u52d9\u52b9\u7387\u5316\u306e\u9375\u3068\u306a\u308a\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u306f\u30013\u3064\u306e\u7570\u306a\u308b\u30b7\u30b9\u30c6\u30e0\uff08A\u3001B\u3001C\uff09\u9593\u3067\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3001\u9001\u4fe1\u3001\u51e6\u7406\u3059\u308b\u57fa\u672c\u7684\u306a\u6d41\u308c\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306e\u696d\u52d9\u3067\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u30de\u30af\u30ed\u3092\u4f7f\u3063\u3066\u3001\u8ca9\u58f2\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u9867\u5ba2\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u3092\u57fa\u306b\u5728\u5eab\u7ba1\u7406\u30b7\u30b9\u30c6\u30e0\u3067\u5728\u5eab\u3092\u78ba\u8a8d\u3057\u3001\u6700\u5f8c\u306b\u914d\u9001\u30b7\u30b9\u30c6\u30e0\u306b\u51fa\u8377\u6307\u793a\u3092\u51fa\u3059\u3068\u3044\u3063\u305f\u4e00\u9023\u306e\u6d41\u308c\u3092\u81ea\u52d5\u5316\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u624b\u4f5c\u696d\u306b\u3088\u308b\u8ee2\u8a18\u30df\u30b9\u3092\u6e1b\u3089\u3057\u3001\u51e6\u7406\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>2. \u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3068\u4f8b\u5916\u51e6\u7406\u306e\u91cd\u8981\u6027<\/h3>\n<p>\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u3092\u884c\u3046\u969b\u3001\u6700\u3082\u6ce8\u610f\u3059\u3079\u304d\u70b9\u306e\u4e00\u3064\u304c\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3067\u3059\u3002\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093\u304c\u3001\u5b9f\u969b\u306e\u904b\u7528\u3067\u306f\u5404\u30b7\u30b9\u30c6\u30e0\u3068\u306e\u901a\u4fe1\u30a8\u30e9\u30fc\u3084\u3001\u30c7\u30fc\u30bf\u4e0d\u6574\u5408\u306b\u3088\u308b\u30a8\u30e9\u30fc\u306a\u3069\u304c\u767a\u751f\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30a8\u30e9\u30fc\u3092\u9069\u5207\u306b\u51e6\u7406\u3057\u3001\u30ed\u30b0\u3092\u6b8b\u3059\u3053\u3068\u3067\u3001\u554f\u984c\u306e\u65e9\u671f\u767a\u898b\u3068\u8fc5\u901f\u306a\u5bfe\u5fdc\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u30b3\u30fc\u30c9\u3092\u5404\u95a2\u6570\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nOn Error GoTo ErrorHandler<br \/>\n&#8216; \u51e6\u7406\u30b3\u30fc\u30c9<br \/>\nExit Function<\/p>\n<p>ErrorHandler:<br \/>\n    Debug.Print &#8220;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f: &#8221; &#038; Err.Description<br \/>\n    &#8216; \u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u8a18\u9332\u3059\u308b\u306a\u3069\u306e\u51e6\u7406<br \/>\nResume Next<br \/>\n&#8220;`<\/p>\n<p>\u3053\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u30de\u30af\u30ed\u306e\u5b9f\u884c\u4e2d\u306b\u554f\u984c\u304c\u767a\u751f\u3057\u3066\u3082\u3001\u51e6\u7406\u304c\u9014\u4e2d\u3067\u6b62\u307e\u308b\u3053\u3068\u306a\u304f\u7d9a\u884c\u3057\u3001\u5f8c\u3067\u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u78ba\u8a8d\u3057\u3066\u554f\u984c\u3092\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>3. \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/h3>\n<p>\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u3092\u884c\u3046\u969b\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316\u3082\u91cd\u8981\u306a\u8ab2\u984c\u3067\u3059\u3002\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306b\u95a2\u3057\u3066\u306f\u3001\u5404\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u30a2\u30af\u30bb\u30b9\u6a29\u9650\u306e\u7ba1\u7406\u3084\u3001\u30c7\u30fc\u30bf\u306e\u6697\u53f7\u5316\u306a\u3069\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u7279\u306b\u3001\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u3068\u306e\u9023\u643a\u3092\u884c\u3046\u5834\u5408\u306f\u3001API\u30ad\u30fc\u306e\u7ba1\u7406\u3084\u8a8d\u8a3c\u60c5\u5831\u306e\u4fdd\u8b77\u306b\u5341\u5206\u6ce8\u610f\u3092\u6255\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316\u306b\u3064\u3044\u3066\u306f\u3001\u5927\u91cf\u306e\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u969b\u306b\u306f\u30d0\u30c3\u30c1\u51e6\u7406\u3092\u691c\u8a0e\u3057\u305f\u308a\u3001\u4e0d\u8981\u306aAPI\u547c\u3073\u51fa\u3057\u3092\u6e1b\u3089\u3059\u305f\u3081\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u5229\u7528\u3057\u305f\u308a\u3059\u308b\u306a\u3069\u306e\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002\u307e\u305f\u3001\u9577\u6642\u9593\u5b9f\u884c\u3055\u308c\u308b\u30de\u30af\u30ed\u306e\u5834\u5408\u306f\u3001\u5b9a\u671f\u7684\u306b\u9032\u6357\u72b6\u6cc1\u3092\u8868\u793a\u3059\u308b\u306a\u3069\u3001\u30e6\u30fc\u30b6\u30fc\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc\u306a\u8a2d\u8a08\u3082\u5fc3\u304c\u3051\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Excel \u30de\u30af\u30ed\u3092\u4f7f\u3063\u305f\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u306f\u3001\u696d\u52d9\u52b9\u7387\u5316\u306e\u5f37\u529b\u306a\u30c4\u30fc\u30eb\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u305d\u306e\u5b9f\u88c5\u306b\u306f\u7d30\u5fc3\u306e\u6ce8\u610f\u3068\u8a08\u753b\u304c\u5fc5\u8981\u3067\u3059\u3002\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316\u3092\u8003\u616e\u306b\u5165\u308c\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u4fe1\u983c\u6027\u306e\u9ad8\u3044\u3001\u52b9\u679c\u7684\u306a\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u3092\u5b9f\u73fe\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u696d\u52d9\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u6975\u610f\uff01\u4e0a\u7d1a\u8005\u5411\u3051\u30b7\u30b9\u30c6\u30e0\u9593\u9023\u643a\u30de\u30af\u30ed \u3059\u3050\u306b\u8a66\u305b\u308b\u4e0a\u7d1a\u8005\u5411\u3051\u30de\u30af\u30ed\u30b3\u30fc\u30c9 #8220;`vba Sub \u8907\u6570\u30b7\u30b9\u30c6\u30e0\u9023\u643a\u30de\u30af\u30ed() Dim ws As Worksheet Dim lastRow<\/p>\n","protected":false},"author":2,"featured_media":515,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-516","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced"],"_links":{"self":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/515"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}