{"id":51,"date":"2021-02-02T08:09:10","date_gmt":"2021-02-01T23:09:10","guid":{"rendered":"http:\/\/192.168.0.97\/bibouroku\/2021\/02\/02\/vlookup-2\/"},"modified":"2021-02-02T08:09:10","modified_gmt":"2021-02-01T23:09:10","slug":"vlookup-2","status":"publish","type":"post","link":"https:\/\/www.donijan.com\/bibouroku\/2021\/02\/vlookup-2.html","title":{"rendered":"VlookUp\u3092\u4f7f\u308f\u306a\u3044\u3067\u8868\u8a18\u3000-\u305d\u306e2-"},"content":{"rendered":"<p>\u30a8\u30af\u30bb\u30eb\u3092\u4f7f\u3063\u3066\u3044\u3066\u30fb\u30fb\u826f\u304f\u4f7f\u3046\u306e\u304cVlookUp\u3067\u3059\u304c\u30fb\u30fb<br \/>\u3069\u3046\u3057\u3066\u3082\u8868\u8a08\u7b97\u95a2\u6570\u304c\u52d5\u304f\u306e\u3067\u9045\u3044!<br \/>\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u304c\u91cd\u304f\u306a\u308b\u30fb\u30fb\u3068\u3044\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>VlookUp\u3092\u4f7f\u308f\u306a\u3044\u3067\u5546\u54c1\u3092\u8868\u8a18\u3055\u305b\u308b\u70ba\u306b\u306f\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210201Ecel-4.jpg\" width=\"1037\" height=\"738\" \/><\/p>\n<p><!--more--><\/p>\n<p>\u30a8\u30af\u30bb\u30eb\u3092\u4f7f\u3063\u3066\u3044\u3066\u30fb\u30fb\u826f\u304f\u4f7f\u3046\u306e\u304cVlookUp\u3067\u3059\u304c\u30fb\u30fb<br \/>\u3069\u3046\u3057\u3066\u3082\u8868\u8a08\u7b97\u95a2\u6570\u304c\u52d5\u304f\u306e\u3067\u9045\u3044!<br \/>\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u304c\u91cd\u304f\u306a\u308b\u30fb\u30fb\u3068\u3044\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>VlookUp\u3092\u4f7f\u308f\u306a\u3044\u3067\u5546\u54c1\u3092\u8868\u8a18\u3055\u305b\u308b\u70ba\u306b\u306f\u30fb\u30fb<\/p>\n<p> \uff11\uff0e\u308f\u3056\u3068\u8a08\u7b97\u65b9\u6cd5\u3092\u624b\u52d5\u306b\u5207\u308a\u63db\u3048\u307e\u3059\u3002<br \/> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-10.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-10.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p>\uff12\uff0e\u624b\u52d5\u306b\u304d\u308a\u304b\u3048\u307e\u3057\u305f\u3002<br \/> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-11.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-11.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p>\uff13\uff0e\uff36\uff22\uff21\u3092\u958b\u3044\u3066\u3001\uff36\uff22\uff21\uff30\uff52\uff4f\uff4a\uff45\uff43\uff54\u306e\u4e2d\u306e\uff33\uff48\uff45\uff45\uff54\uff11\u306e\u4e2d\u306b<br \/> \u3000\u3000\uff37\uff4f\uff52\uff4b\uff53\uff48\uff45\uff45\uff54\u3000\uff23\uff48\uff41\uff4e\uff47\uff45\u306e\u30b3\u30de\u30f3\u30c9\u3092\u8a18\u8f09\u3057\u307e\u3059\u3002<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-1.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-1.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff14\uff0e\u958b\u304d\u65b9\u306f\u3001\u30a8\u30af\u30bb\u30eb\u3092\u958b\u3044\u3066\u3044\u308b\u6642\u306b\u3001\uff21\uff4c\uff54\u3000\uff0b\u3000\uff26\uff11\uff11\u3000\u306e\u30ad\u30fc\u3092\u540c\u6642\u306b\u62bc\u3059\u3068\u958b\u304d\u307e\u3059\u3002<br \/> \u3000\u3000\u3053\u306e\uff33\uff48\uff45\uff45\uff54\uff11\uff08\uff33\uff48\uff45\uff45\uff54\uff11\uff09\u3092\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-2.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-2.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff15\uff0e\u3053\u3093\u306a\u753b\u9762\u306b\u306a\u308b\u3001\u305d\u3053\u3067\u30fb\u30fb<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-3.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-3.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p>\uff16\uff0e\u4ee5\u4e0b\u306e\u69d8\u306b\uff37\uff4f\uff52\uff4b\uff53\uff48\uff45\uff45\uff54\u3092\u9078\u3076\u3068<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-4.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-4.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff17\uff0e\u4ee5\u4e0b\u306e\u69d8\u306a\uff33\uff45\uff4c\uff45\uff43\uff54\uff49\uff4f\uff4e\uff23\uff48\uff41\uff4e\uff47\uff45\u304c\u958b\u304f\u306e\u3067<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-5.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-5.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff18\uff0e\uff33\uff45\uff4c\uff45\uff43\uff54\uff49\uff4f\uff4e\uff23\uff48\uff41\uff4e\uff47\uff45\u3067\u306f\u306a\u304f\uff23\uff48\uff41\uff4e\uff47\uff45\u3092\u9078\u629e\u3002<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-6.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-6.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff19\uff0e\uff37\uff4f\uff52\uff4b\uff53\uff48\uff45\uff45\uff54\uff3f\uff33\uff45\uff4c\uff45\uff43\uff54\uff49\uff4f\uff4e\uff23\uff48\uff41\uff4e\uff47\uff45\u306f\u4f7f\u308f\u306a\u3044\u306e\u3067\u3001\u6d88\u53bb\u3057\u3000\uff37\uff4f\uff52\uff4b\uff53\uff48\uff45\uff45\uff54\uff3f\uff23\uff48\uff41\uff4e\uff47\uff45\u306b\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-7.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-7.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p>\uff11\uff10\uff0e\u4ee5\u4e0b\u306e\u69d8\u306b\u3057\u3066<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-8.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-8.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p> \uff11\uff11\uff0e\u3042\u3068\u306f\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u8fbc\u3080<\/p>\n<p> <a href=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-9.jpg\"> <img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"http:\/\/www.donijan.com\/motohiro\/Bibouroku\/2021\/Excel\/Img\/20210202Ecel-9.jpg\" width=\"800\" height=\"586\" \/><\/a><\/p>\n<p>\u3000<\/p>\n<p>\uff11\uff12\uff0e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a<\/p>\n<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>&#8216;\u8a72\u5f53\u306e\u5217\u306e\u5024\u304c\u5909\u66f4\u3055\u308c\u305f\u5834\u5408<br \/> Private Sub Worksheet_Change(ByVal Target As Range)<\/p>\n<p> &#8216;\u5909\u6570\u306e\u5ba3\u8a00<br \/> Dim i As Long &#8216;\u30eb\u30fc\u30d7\u306e\u884c\u30ab\u30a6\u30f3\u30c8<br \/> Dim col As Long &#8216;\u30eb\u30fc\u30d7\u306e\u5217\u30ab\u30a6\u30f3\u30c8<br \/> Dim Sh1LastCol As Long &#8216;\u30b7\u30fc\u30c82\u306e\u6700\u7d42\u5217<br \/> Dim Sh2LastRow As Long &#8216;\u30b7\u30fc\u30c82\u306e\u6700\u7d42\u884c<br \/> Dim Sh2LastCol As Long &#8216;\u30b7\u30fc\u30c82\u306e\u6700\u7d42\u5217<\/p>\n<p> &#8216;\u6700\u7d42\u884c\u3068\u6700\u7d42\u5217\u306e\u53d6\u5f97<br \/> Sh1LastCol = 11 &#8216;\u7d0d\u54c1\u66f8\u306e\u6700\u7d42\u5217\u306f11\u5217\u76ee<br \/> Sh2LastRow = Sheets(&#8220;Sheet2&#8221;).Cells(Rows.Count, 2).End(xlUp).Row<br \/> Sh2LastCol = Sheets(&#8220;Sheet2&#8221;).Cells(3, Columns.Count).End(xlToLeft).Column<\/p>\n<p> Select Case Target.Column &#8216;\u5909\u66f4\u3055\u308c\u305f\u5217\u304c<br \/> Case 3 &#8216;3\u5217\u76ee(\u3059\u306a\u308f\u3061C\u306e\u5217)\u306e\u5834\u5408\u3067<br \/> Select Case Target.Value<br \/> Case &#8220;&#8221; &#8216;\u7a7a\u767d\u306e\u5834\u5408<br \/> For col = 4 To Sh1LastCol &#8216;\u5217\u756a\u53f7\u304c2\u5217\u76ee\u304b\u3089\u6700\u7d42\u5217\u307e\u3067\u306e\u9593\u30eb\u30fc\u30d7\u3059\u308b<br \/> Cells(Target.Row, col) = &#8220;&#8221; &#8216;4\u5217\u76ee\u304b\u3089\u306e\u5024\u3092\u6d88\u53bb<br \/> Next col<br \/> Case Else &#8216;\u7a7a\u767d\u3067\u7121\u3044\u5834\u5408<br \/> &#8216;\u30eb\u30fc\u30d7\u306e\u958b\u59cb<br \/> For i = 3 To Sh2LastRow &#8216;\u30b7\u30fc\u30c82\u306e3\u884c\u76ee\u304b\u3089\u6700\u7d42\u884c\u307e\u3067\u306e\u9593\u3067<\/p>\n<p> Select Case Sheets(&#8220;Sheet2&#8221;).Cells(i, 2) &#8216;\u30b7\u30fc\u30c82\u306e2\u5217\u76ee\u306e\u30b3\u30fc\u30c9\u304c<br \/> Case Right(&#8220;0000000000000&#8221; &amp; Target.Value, 13) &#8216;\u30b7\u30fc\u30c81\u306e\u5909\u66f4\u3055\u308c\u305f\u8a72\u5f53\u30bb\u30eb\u306e\u5024\u3060\u3063\u305f\u3089<\/p>\n<p> &#8216;\u5217\u306e\u5024\u3092\u66f8\u304d\u8fbc\u3080<br \/> For col = 2 To Sh2LastCol &#8216;\u5217\u756a\u53f7\u304c2\u5217\u76ee\u304b\u3089\u6700\u7d42\u5217\u307e\u3067\u306e\u9593\u30eb\u30fc\u30d7\u3059\u308b<\/p>\n<p> Select Case col &#8216;\u5217\u306e\u756a\u53f7\u304c<br \/> Case 3: Cells(Target.Row, 4) = Sheets(&#8220;Sheet2&#8221;).Cells(i, col) &#8216;Sheet2\u306e3\u5217\u76ee \u3059\u306a\u308f\u3061 \u5546\u54c1\u540d\u3092 Sheet1\u306e4\u5217\u76ee\u306b\u66f8\u304d\u8fbc\u3080<br \/> Case 4: Cells(Target.Row, 5) = Sheets(&#8220;Sheet2&#8221;).Cells(i, col) &#8216;Sheet2\u306e4\u5217\u76ee \u3059\u306a\u308f\u3061 \u5165\u308a\u6570\u3092 Sheet1\u306e5\u5217\u76ee\u306b\u66f8\u304d\u8fbc\u3080<br \/> Case 5<br \/> Case 6: Cells(Target.Row, 9) = Sheets(&#8220;Sheet2&#8221;).Cells(i, col) &#8216;Sheet2\u306e6\u5217\u76ee \u3059\u306a\u308f\u3061 \u58f2\u4fa1\u3092 Sheet1\u306e9\u5217\u76ee\u306b\u66f8\u304d\u8fbc\u3080<br \/> Case 7<br \/> Case 8: Cells(Target.Row, 11) = Sheets(&#8220;Sheet2&#8221;).Cells(i, col) &#8216;Sheet2\u306e8\u5217\u76ee \u3059\u306a\u308f\u3061 \u7a0e\u533a\u5206\u3092 Sheet1\u306e11\u5217\u76ee\u306b\u66f8\u304d\u8fbc\u3080<br \/> End Select<\/p>\n<p> Next col &#8216;\u5217\u306e\u51e6\u7406\u306e\u30eb\u30fc\u30d7\u3053\u3053\u307e\u3067<br \/> Cells(Target.Row + 1, Target.Column).Select &#8216;\u6b21\u306e\u884c\u3092Select \u3059\u308b<br \/> Exit For &#8216;\u8a72\u5f53\u3059\u308b\u884c\u3067\u306e\u51e6\u7406\u304c\u304a\u308f\u3063\u305f\u3089\u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b<br \/> End Select<\/p>\n<p> Next i &#8216;\u884c\u306e\u51e6\u7406\u306e\u30eb\u30fc\u30d7\u3053\u3053\u307e\u3067<\/p>\n<p> End Select<br \/> End Select<br \/> End Sub<\/p>\n<p> &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>\u3053\u3093\u306a\u304b\u3093\u3058\u3067\u3059\u306d\u3002<\/p>\n<p>\u3000<\/p>\n<p>\u3042\u3068\u30fb\u30fb\u30fb<br \/> \u30a8\u30af\u30bb\u30eb\u306e\u5834\u5408\u306f\u30fb\u30fb\u30fb<\/p>\n<p>\u30b3\u30fc\u30c9\u306a\u3069\u3092\u53d6\u308a\u6271\u3046\u3068\u304d\u30fb\u30fb\u52dd\u624b\u306b\u30bb\u30eb\u3092\u6570\u5024\u306b\u5909\u3048\u305f\u308a<br \/> \u6587\u5b57\u5316\u3051\u3059\u308b\u4e8b\u304c\u3042\u308b\u306e\u3067\u30fb\u30fb\u30fb<\/p>\n<p>\u3082\u3046\u4e00\u3064\u3053\u308c\u3092\u4ed8\u3051\u52a0\u3048\u3066\u304a\u304d\u307e\u3059\u3002<br \/> \u3000<\/p>\n<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p> &#8216;\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u304c\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u306a\u3063\u305f\u3068\u304d\u306b<br \/> &#8216;\u6587\u5b57\u5316\u3051\u3092\u9632\u3050\u305f\u3081\u306b\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3057\u3066\u304a\u304f<br \/> Private Sub Worksheet_Activate()<br \/> Columns(&#8220;C:C&#8221;).NumberFormatLocal = &#8220;@&#8221;<br \/> End Sub<\/p>\n<p>&#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a8\u30af\u30bb\u30eb\u3092\u4f7f\u3063\u3066\u3044\u3066\u30fb\u30fb\u826f\u304f\u4f7f\u3046\u306e\u304cVlookUp\u3067\u3059\u304c\u30fb\u30fb\u3069\u3046\u3057\u3066\u3082\u8868\u8a08\u7b97\u95a2\u6570\u304c\u52d5\u304f\u306e\u3067\u9045\u3044!\u30d5\u30a1\u30a4\u30eb\u81ea\u4f53\u304c\u91cd\u304f\u306a\u308b\u30fb\u30fb\u3068\u3044\u3046\u4e8b\u304c\u3042\u308a\u307e\u3059\u3002 VlookUp\u3092\u4f7f\u308f\u306a\u3044\u3067\u5546\u54c1\u3092\u8868\u8a18\u3055\u305b\u308b\u70ba\u306b\u306f\u30fb\u30fb<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,17],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-excel","category-vba"],"_links":{"self":[{"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/posts\/51"}],"collection":[{"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donijan.com\/bibouroku\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}