{"id":2991,"date":"2023-11-18T05:28:14","date_gmt":"2023-11-18T05:28:14","guid":{"rendered":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/"},"modified":"2023-12-07T04:56:28","modified_gmt":"2023-12-07T04:56:28","slug":"%e7%b5%b5%e7%94%bb","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/","title":{"rendered":"Vba \u8868: \u57fa\u672c\u304b\u3089\u4e0a\u7d1a\u307e\u3067\u306e\u30ac\u30a4\u30c9"},"content":{"rendered":"<div class=\"excel-\" id=\"excel-1157963319\"><script type=\"text\/javascript\">\r\n\tatOptions = {\r\n\t\t'key' : 'c1158f160081d6540a8409e6925dab94',\r\n\t\t'format' : 'iframe',\r\n\t\t'height' : 250,\r\n\t\t'width' : 300,\r\n\t\t'params' : {}\r\n\t};\r\n<\/script>\r\n<script type=\"text\/javascript\" src=\"\/\/www.highperformanceformat.com\/c1158f160081d6540a8409e6925dab94\/invoke.js\"><\/script><\/div> <p class=\"wp-block-heading\"><strong>\u30ad\u30fc\u30dd\u30a4\u30f3\u30c8<\/strong><\/p><ul><li>VBA \u30c6\u30fc\u30d6\u30eb\u5185\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3001\u30c7\u30fc\u30bf (\u4f8b: \u751f\u5f92\u306e\u540d\u524d\u3001\u79d1\u76ee\u3001\u5f97\u70b9) \u3092\u4fdd\u5b58\u304a\u3088\u3073\u6574\u7406\u3059\u308b\u305f\u3081\u306e\u30df\u30cb \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u8003\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/li><li>\u3053\u308c\u3092\u4f7f\u7528\u3059\u308b\u524d\u306b\u3001\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u3068\u305d\u3053\u306b\u4fdd\u5b58\u3057\u305f\u3044\u5024\u306e\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li><\/ul><p> VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u3001VBA \u30b3\u30fc\u30c9\u3067\u306e\u30c6\u30fc\u30d6\u30eb\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30ac\u30a4\u30c9\u3067\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u3042\u3089\u3086\u308b\u5074\u9762\u3092\u63a2\u7d22\u3057\u3001\u4f7f\u7528\u3059\u308b\u4f8b\u3082\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002\u5f7c\u3089\u3002<\/p><h2 class=\"wp-block-heading\"> VBA\u306e\u30c6\u30fc\u30d6\u30eb\u3068\u306f\u4f55\u3067\u3059\u304b?<\/h2><p> VBA \u3067\u306f\u3001\u914d\u5217\u306f<strong>\u8907\u6570\u306e\u5024\u3092\u683c\u7d0d<\/strong>\u3067\u304d\u308b\u5909\u6570\u3067\u3059\u3002\u3053\u306e\u914d\u5217\u5185\u306e\u3059\u3079\u3066\u306e\u5024\u306b\u4e00\u5ea6\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3082\u3001\u914d\u5217\u5185\u306e\u305d\u306e\u5024\u306e\u4f4d\u7f6e\u3067\u3042\u308b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u6307\u5b9a\u3057\u3066 1 \u3064\u306e\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u751f\u5f92\u306e\u540d\u524d\u3001\u79d1\u76ee\u3001\u6210\u7e3e\u3092\u6307\u5b9a\u3059\u308b\u7d04\u675f\u304c\u3042\u308b\u3068\u60f3\u50cf\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p><p> 1 \u4eba\u306e\u751f\u5f92\u3060\u3051\u3067\u306a\u304f\u3001\u6570\u767e\u4eba\u306e\u751f\u5f92\u306e\u60c5\u5831\u3092\u3059\u3079\u3066\u30c6\u30fc\u30d6\u30eb\u306b\u4fdd\u5b58\u3067\u304d\u307e\u3059\u3002\u30c6\u30fc\u30d6\u30eb\u3092\u8aac\u660e\u3059\u308b\u305f\u3081\u306e\u7c21\u5358\u306a\u4f8b\u3092\u6b21\u306b\u793a\u3057\u307e\u3059\u3002 <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-52233\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png\" sizes=\"auto, \" srcset=\"\" alt=\"\u8868\u306e\u8aac\u660e\u4f8b\" width=\"511\" height=\"303\"><\/figure><\/div><p>\u4e0a\u306e\u4f8b\u3067\u306f\u300110 \u500b\u306e\u8981\u7d20 (\u914d\u5217\u30b5\u30a4\u30ba) \u304b\u3089\u306a\u308b\u914d\u5217\u304c\u3042\u308a\u3001\u5404\u8981\u7d20\u306b\u306f\u7279\u5b9a\u306e\u4f4d\u7f6e (\u30a4\u30f3\u30c7\u30c3\u30af\u30b9) \u304c\u3042\u308a\u307e\u3059\u3002<\/p><p>\u3057\u305f\u304c\u3063\u3066\u30018 \u756a\u76ee\u306e\u4f4d\u7f6e\u306b\u3042\u308b\u8981\u7d20\u3092\u4f7f\u7528\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u305d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u4f7f\u7528\u3057\u3066\u305d\u306e\u8981\u7d20\u3092\u53c2\u7167\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p><p>\u4e0a\u306e\u4f8b\u3067\u4f7f\u7528\u3057\u305f\u914d\u5217\u306f 1 \u6b21\u5143\u914d\u5217\u3067\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u306e\u30ac\u30a4\u30c9\u306e\u5f8c\u534a\u3067\u306f\u3001\u591a\u6b21\u5143\u914d\u5217\u306b\u3064\u3044\u3066\u3082\u5b66\u7fd2\u3057\u307e\u3059\u3002<\/p><h2 class=\"wp-block-heading\"> VBA\u3067\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u65b9\u6cd5<\/h2><p>\u4e0a\u3067\u8ff0\u3079\u305f\u3088\u3046\u306b\u3001\u914d\u5217\u306f\u5909\u6570\u306e\u578b\u3067\u3042\u308b\u305f\u3081\u3001\u30ad\u30fc\u30ef\u30fc\u30c9 (Dim\u3001Private\u3001Public\u3001\u304a\u3088\u3073 Static) \u3092\u4f7f\u7528\u3057\u3066\u5ba3\u8a00\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u901a\u5e38\u306e\u5909\u6570\u3068\u306f\u7570\u306a\u308a\u3001\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u3068\u304d\u306f\u3001\u914d\u5217\u540d\u306e\u5f8c\u306b 1 \u7d44\u306e\u304b\u3063\u3053\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p><p>\u4e0a\u306e\u4f8b\u3067\u4f7f\u7528\u3057\u305f\u914d\u5217\u3092\u5ba3\u8a00\u3057\u305f\u3044\u3068\u3057\u307e\u3059\u3002<\/p><p><strong>\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u624b\u9806\u3002<\/strong><\/p><ul><li>\u307e\u305a\u3001\u30ad\u30fc\u30ef\u30fc\u30c9\u300cDim\u300d\u3092\u4f7f\u7528\u3057\u3001\u30c6\u30fc\u30d6\u30eb\u540d\u3092\u5165\u529b\u3057\u3001\u304b\u3063\u3053\u3092\u5165\u529b\u3057\u307e\u3059\u3002 <br><img loading=\"lazy\" decoding=\"async\" title=\"2-\u30ad\u30fc\u30ef\u30fc\u30c9-dim \u3092\u4f7f\u7528\u3059\u308b\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/2-utiliser-le-mot-cle-dim.png\" sizes=\"auto, \" srcset=\"\" alt=\"use-the-keyword-dim\" width=\"375\" height=\"215\"><\/li><li>\u6b21\u306b\u3001\u914d\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u578b\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001VBA \u306b\u3088\u3063\u3066\u9069\u5207\u306a\u30c7\u30fc\u30bf\u578b\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002 <br><img loading=\"lazy\" decoding=\"async\" title=\"3-\u914d\u5217\u306e\u30c7\u30fc\u30bf\u578b\u3092\u6307\u5b9a\u3059\u308b\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/3-specifier-le-type-de-donnees-dun-tableau.png\" sizes=\"auto, \" srcset=\"\" alt=\"specify-data-type-of-an-array\" width=\"377\" height=\"197\"><\/li><li>\u305d\u306e\u5f8c\u3001\u914d\u5217\u306b\u683c\u7d0d\u3059\u308b\u8981\u7d20\u306e\u6570\u3092\u5b9a\u7fa9\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 <br><img loading=\"lazy\" decoding=\"async\" title=\"4\u30bb\u30c3\u30c8\u306e\u5546\u54c1\u6570\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/4-definir-le-nombre-darticles.png\" sizes=\"auto, \" srcset=\"\" alt=\"define-the-number-of-items\" width=\"381\" height=\"176\"><\/li><li>\u6700\u7d42\u7684\u306b\u3001\u914d\u5217\u5185\u306e\u8981\u7d20\u306b\u5024\u3092\u5272\u308a\u5f53\u3066\u308b\u306b\u306f\u3001\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u4f7f\u7528\u3057\u3066\u8981\u7d20\u3092\u8b58\u5225\u3057\u3001\u5024\u3092\u5272\u308a\u5f53\u3066\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 <br><img loading=\"lazy\" decoding=\"async\" title=\"5-\u9805\u76ee\u306b\u5024\u3092\u5272\u308a\u5f53\u3066\u308b\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/5-attribuer-une-valeur-a-un-element.png\" sizes=\"auto, \" srcset=\"\" alt=\"assign-a-vale-to-an-item\" width=\"336\" height=\"391\"><\/li><\/ul><p><strong>\u5b8c\u5168\u306a\u30b3\u30fc\u30c9<\/strong><\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_array_example() Dim StudentsNames(10) As String StudentsNames(0) = \"Waylon\" StudentsNames(1) = \"Morton\" StudentsNames(2) = \"Rudolph\" StudentsNames(3) = \"Georgene\" StudentsNames(4) = \"Billi\" StudentsNames(5) = \"Enid\" StudentsNames(6) = \"Genevieve\" StudentsNames(7) = \"Judi\" StudentsNames(8) = \"Madaline\" StudentsNames(9) = \"Elton\" End Sub<\/code><\/pre><h3 class=\"wp-block-heading\">\u7c21\u5358\u306a\u30e1\u30e2<\/h3><ul><li>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u6700\u521d\u306b\u3001\u6700\u5927 10 \u500b\u306e\u8981\u7d20\u3092\u683c\u7d0d\u3067\u304d\u3001\u6587\u5b57\u5217\u30c7\u30fc\u30bf\u578b\u3092\u6301\u3064 1 \u6b21\u5143\u914d\u5217\u3092\u5b9a\u7fa9\u3059\u308b Dim \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/li><li>\u305d\u306e\u5f8c\u30010 \u304b\u3089 9 \u307e\u3067\u306e\u914d\u5217\u306e\u8981\u7d20\u3092\u5b9a\u7fa9\u3059\u308b 10 \u884c\u306e\u30b3\u30fc\u30c9\u304c\u5b8c\u6210\u3057\u307e\u3059\u3002<\/li><\/ul><h3 class=\"wp-block-heading\">\u3055\u307e\u3056\u307e\u306a\u30c7\u30fc\u30bf\u578b\u3092\u6301\u3064\u30c6\u30fc\u30d6\u30eb<\/h3><p>\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u3068\u304d\u306b\u30c7\u30fc\u30bf\u578b\u3092\u6307\u5b9a\u3057\u306a\u3044\u3068\u3001VBA \u306f\u3055\u307e\u3056\u307e\u306a\u30c7\u30fc\u30bf\u578b\u3092\u81ea\u52d5\u7684\u306b\u4f7f\u7528\u3059\u308b\u305f\u3081\u3001\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u304c\u308f\u305a\u304b\u306b\u5897\u52a0\u3057\u307e\u3059\u3002\u3053\u306e\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf\u306e\u5897\u52a0\u306b\u3088\u308a\u3001\u30b3\u30fc\u30c9\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u4f4e\u4e0b\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p><p>\u3057\u305f\u304c\u3063\u3066\u3001\u30d0\u30ea\u30a2\u30f3\u30c8 \u30c7\u30fc\u30bf\u578b\u3092\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u306a\u3044\u9650\u308a\u3001\u914d\u5217\u3092\u5ba3\u8a00\u3059\u308b\u3068\u304d\u306b\u7279\u5b9a\u306e\u30c7\u30fc\u30bf\u578b\u3092\u5b9a\u7fa9\u3059\u308b\u3053\u3068\u304c\u6700\u5584\u3067\u3059\u3002<\/p><h2 class=\"wp-block-heading\">\u914d\u5217\u304b\u3089\u60c5\u5831\u3092\u8fd4\u3059<\/h2><p>\u914d\u5217\u304b\u3089\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u524d\u8ff0\u3057\u305f\u3088\u3046\u306b\u3001\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u756a\u53f7\u3092\u4f7f\u7528\u3057\u3066\u305d\u306e\u4f4d\u7f6e\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u524d\u306e\u4f8b\u3067\u4f5c\u6210\u3057\u305f\u9818\u57df\u306e 8 \u756a\u76ee\u306e\u8981\u7d20\u3092\u8fd4\u3057\u305f\u3044\u5834\u5408\u3001\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-52238\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/6-retour-dinformations-a-partir-dun-tableau.png\" sizes=\"auto, \" srcset=\"\" alt=\"\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u306e\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\" width=\"479\" height=\"451\"><\/figure><\/div><p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u914d\u5217\u8981\u7d20 8 \u3092\u4f7f\u7528\u3057\u3066\u30bb\u30eb A1 \u306b\u5024\u3092\u5165\u529b\u3057\u307e\u3057\u305f\u3002<\/p><h2 class=\"wp-block-heading\">\u30aa\u30d7\u30b7\u30e7\u30f3\u30d9\u30fc\u30b91\u3092\u4f7f\u7528<\/h2><p>\u3042\u306a\u305f\u306f\u4eca\u3001\u306a\u305c\u9805\u76ee\u30ea\u30b9\u30c8\u3092 1 \u304b\u3089\u3067\u306f\u306a\u304f 0 \u304b\u3089\u59cb\u3081\u305f\u306e\u304b\u3068\u3044\u3046\u7591\u554f\u3092\u62b1\u3044\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p><p>\u307e\u3042\u3001\u305d\u308c\u306f\u9593\u9055\u3044\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p><p>\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u304c\u6700\u521d\u306b\u69cb\u7bc9\u3055\u308c\u305f\u3068\u304d<a href=\"http:\/\/www.cs.utexas.edu\/users\/EWD\/transcriptions\/EWD08xx\/EWD831.html\" target=\"_blank\" rel=\"noreferrer noopener\">\u3001\u4f55\u3089\u304b\u306e\u4e0d\u6ce8\u610f\u306b\u3088\u308a\u3001\u3053\u306e\u69cb\u9020\u306f\u914d\u5217\u5185\u306e\u8981\u7d20\u306e\u30ea\u30b9\u30c8\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f<\/a>\u3002\u307b\u3068\u3093\u3069\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3067\u306f\u3001\u30ea\u30b9\u30c8\u9805\u76ee\u306e\u540c\u3058\u69cb\u9020\u304c\u898b\u3089\u308c\u307e\u3059\u3002<\/p><p>\u305f\u3060\u3057\u3001\u4ed6\u306e\u307b\u3068\u3093\u3069\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u8a00\u8a9e\u3068\u306f\u7570\u306a\u308a\u3001VBA \u3067\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u52d5\u4f5c\u3092\u6b63\u898f\u5316\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092 1 \u304b\u3089\u958b\u59cb\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5fc5\u8981\u306a\u306e\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u5ba3\u8a00\u3059\u308b\u524d\u306b\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5148\u982d\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u57fa\u3065\u3044\u305f\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3060\u3051\u3067\u3059\u3002\u914d\u5217.\u914d\u5217\u3002<\/p><p>\u3053\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-52239\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/7-utiliser-la-base-doptions-1.png\" sizes=\"auto, \" srcset=\"\" alt=\"\u4f7f\u7528\u30aa\u30d7\u30b7\u30e7\u30f3\u30d9\u30fc\u30b9-1\" width=\"344\" height=\"424\"><\/figure><\/div><h2 class=\"wp-block-heading\">\u8868\u5185\u3067\u691c\u7d22\u3059\u308b<\/h2><p>\u5024\u3092\u914d\u5217\u306b\u683c\u7d0d\u3059\u308b\u5834\u5408\u3001\u914d\u5217\u306e\u691c\u7d22\u304c\u5fc5\u8981\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p><p>\u3053\u306e\u5834\u5408\u3001\u4f7f\u7528\u3067\u304d\u308b\u65b9\u6cd5\u3092\u77e5\u3063\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306b\u3001\u914d\u5217\u5185\u306e\u5024\u3092\u691c\u7d22\u3059\u308b\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002 <\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub vba_array_search() 'this section declares an array and variables _ that you need to search within the array. Dim myArray(10) As Integer Dim i As Integer Dim varUserNumber As Variant Dim strMsg As String 'This part of the code adds 10 random numbers to _ the array and shows the result in the _ immediate window as well. For i = 1 To 10 myArray(i) = Int(Rnd * 10) Debug.Print myArray(i) Next i 'it is an input box that asks you the number that you want to find. Loopback: varUserNumber = InputBox _ (\"Enter a number between 1 and 10 to search for:\", _ \"Linear Search Demonstrator\") 'it's an IF statement that checks for the value that you _ have entered in the input box. If varUserNumber = \"\" Then End If Not IsNumeric(varUserNumber) Then GoTo Loopback If varUserNumber &lt; 1 Or varUserNumber &gt; 10 Then GoTo Loopback 'message to show if the value doesn't found. strMsg = \"Your value, \" &amp; varUserNumber &amp; _ \", was not found in the array.\" 'loop through the array and match each value with the _ the value you have entered in the input box. For i = 1 To UBound(myArray) If myArray(i) = varUserNumber Then strMsg = \"Your value, \" &amp; varUserNumber &amp; _ \", was found at position \" &amp; i &amp; \" in the array.\" Exit For End If Next i 'message box in the end MsgBox strMsg, vbOKOnly + vbInformation, \"Linear Search Result\" End Sub<\/code> <\/pre><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-52240\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/8-recherche-dans-un-tableau.png\" sizes=\"auto, \" srcset=\"\" alt=\"\u30c6\u30fc\u30d6\u30eb\u5185\u3092\u691c\u7d22\u3059\u308b\" width=\"529\" height=\"1087\"><\/figure><\/div><ol><li>\u30b3\u30fc\u30c9\u306e\u6700\u521d\u306e\u90e8\u5206\u306b\u306f\u3001\u30b3\u30fc\u30c9\u306e\u5f8c\u534a\u3067\u4f7f\u7528\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5909\u6570\u304c\u3042\u308a\u307e\u3059\u3002<\/li><li>\u305d\u306e\u5f8c\u3001\u6b21\u306e\u90e8\u5206\u306f\u3001RND \u3092\u4f7f\u7528\u3057\u3066\u4e71\u6570\u3092\u751f\u6210\u3057\u3001\u914d\u5217\u306e 10 \u500b\u306e\u5024\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/li><li>\u6b21\u306b\u3001\u30c6\u30fc\u30d6\u30eb\u5185\u3067\u691c\u7d22\u3059\u308b\u5024\u3092\u5165\u529b\u3059\u308b\u5165\u529b\u30dc\u30c3\u30af\u30b9\u3067\u3059\u3002<\/li><li>\u3053\u306e\u90e8\u5206\u306b\u306f\u3001\u5165\u529b\u3057\u305f\u5024\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u306b\u30e1\u30c3\u30bb\u30fc\u30b8 \u30dc\u30c3\u30af\u30b9\u3067\u4f7f\u7528\u3059\u308b\u6587\u5b57\u5217\u306e\u30b3\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/li><li>\u30b3\u30fc\u30c9\u306e\u3053\u306e\u90e8\u5206\u3067\u306f\u3001\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3057\u3066\u914d\u5217\u306e\u5404\u8981\u7d20\u3092\u30eb\u30fc\u30d7\u3057\u3001\u5165\u529b\u3057\u305f\u5024\u304c\u914d\u5217\u5185\u306b\u3042\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/li><li>\u30b3\u30fc\u30c9\u306e\u6700\u5f8c\u306e\u90e8\u5206\u3067\u306f\u3001\u5024\u304c\u898b\u3064\u304b\u3063\u305f\u304b\u3069\u3046\u304b\u3092\u793a\u3059\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/li><\/ol><div class=\"gb-container gb-container-4db6181c gb-container-mt\"> <a class=\"gb-button gb-button-c5897111 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/ja\/vba\/\">VBA\u3068\u306f<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\">VBA \u30c6\u30fc\u30d6\u30eb\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u3061\u3089\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002 <\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-a20baf7c gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-65ddf67e\"><div class=\"gb-container gb-container-65ddf67e\"><ul><li> VBA\u914d\u5217\u306e\u9577\u3055(\u30b5\u30a4\u30ba)<\/li><li>\u6587\u5b57\u5217\u3092\u542b\u3080 VBA \u914d\u5217<\/li><li>VBA \u914d\u5217\u306e\u30af\u30ea\u30a2<\/li><li>\u52d5\u7684\u30c6\u30fc\u30d6\u30ebVBA <\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-50067b57\"><div class=\"gb-container gb-container-50067b57\"><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ub_ctt_via":"","footnotes":""},"class_list":["post-2991","page","type-page","status-publish","hentry"],"featured_image_src":null,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor<\/title>\n<meta name=\"description\" content=\"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceladvisor.org\/ja\/\u7d75\u753b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor\" \/>\n<meta property=\"og:description\" content=\"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/ja\/\u7d75\u753b\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-07T04:56:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data1\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/\",\"url\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/\",\"name\":\"VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png\",\"datePublished\":\"2023-11-18T05:28:14+00:00\",\"dateModified\":\"2023-12-07T04:56:28+00:00\",\"description\":\"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/exceladvisor.org\/ja\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vba \u8868: \u57fa\u672c\u304b\u3089\u4e0a\u7d1a\u307e\u3067\u306e\u30ac\u30a4\u30c9\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/#website\",\"url\":\"https:\/\/exceladvisor.org\/ja\/\",\"name\":\"Excel Advisor\",\"description\":\"\u30c7\u30fc\u30bf\u3092\u652f\u914d\u3059\u308b\u305f\u3081\u306e\u7a76\u6975\u306e\u30ac\u30a4\u30c9!\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/ja\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/ja\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/exceladvisor.org\/ja\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/ja\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/ja\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/ja\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor","description":"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exceladvisor.org\/ja\/\u7d75\u753b\/","og_locale":"ja_JP","og_type":"article","og_title":"VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor","og_description":"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002","og_url":"https:\/\/exceladvisor.org\/ja\/\u7d75\u753b\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-07T04:56:28+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/","url":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/","name":"VBA \u306e\u30c6\u30fc\u30d6\u30eb\u306b\u95a2\u3059\u308b\u521d\u5fc3\u8005\u5411\u3051\u30ac\u30a4\u30c9 - Excel Advisor","isPartOf":{"@id":"https:\/\/exceladvisor.org\/ja\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png","datePublished":"2023-11-18T05:28:14+00:00","dateModified":"2023-12-07T04:56:28+00:00","description":"VBA \u3092\u4f7f\u7528\u3057\u3066\u30d3\u30c3\u30b0 \u30c7\u30fc\u30bf\u3092\u64cd\u4f5c\u3059\u308b\u5834\u5408\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u3068\u305d\u306e\u4f7f\u7528\u65b9\u6cd5\u3092\u7406\u89e3\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-exemple-pour-expliquer-un-tableau.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/ja\/%e7%b5%b5%e7%94%bb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/exceladvisor.org\/ja\/"},{"@type":"ListItem","position":2,"name":"Vba \u8868: \u57fa\u672c\u304b\u3089\u4e0a\u7d1a\u307e\u3067\u306e\u30ac\u30a4\u30c9"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/ja\/#website","url":"https:\/\/exceladvisor.org\/ja\/","name":"Excel Advisor","description":"\u30c7\u30fc\u30bf\u3092\u652f\u914d\u3059\u308b\u305f\u3081\u306e\u7a76\u6975\u306e\u30ac\u30a4\u30c9!","publisher":{"@id":"https:\/\/exceladvisor.org\/ja\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/ja\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/ja\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/ja\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/exceladvisor.org\/ja\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/ja\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/ja\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/ja\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/pages\/2991","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/comments?post=2991"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/pages\/2991\/revisions"}],"predecessor-version":[{"id":4176,"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/pages\/2991\/revisions\/4176"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/ja\/wp-json\/wp\/v2\/media?parent=2991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}