{"id":18339,"date":"2026-07-19T02:16:18","date_gmt":"2026-07-18T17:16:18","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=18339"},"modified":"2026-07-19T02:16:18","modified_gmt":"2026-07-18T17:16:18","slug":"cc-vba-array-init","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-vba-array-init\/","title":{"rendered":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u914d\u5217\u306e\u521d\u671f\u5316\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cReDim\u30fbPreserve\u30fbArray\u30fbErase\u3092\u696d\u52d9\u3067\u5fb9\u5e95\u89e3\u8aac"},"content":{"rendered":"\n<style>\n.g-flow-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;align-items:center;}\n.g-flow-item{background:linear-gradient(135deg,#1a1a1a,#2a1015);color:#fff;border-radius:8px;padding:16px 14px;min-width:130px;flex:1;text-align:center;}\n.g-flow-arrow{color:#dc2626;font-size:20px;font-weight:700;}\n.g-card-row{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 32px;}\n.g-card-row>div{flex:1;min-width:220px;}\n@media(max-width:600px){\n  .g-flow-row{flex-direction:column;}\n  .g-flow-arrow{transform:rotate(90deg);}\n  .g-card-row{flex-direction:column;}\n  .g-card-row>div{min-width:100%;}\n}\n<\/style>\n\n\n\n<div style=\"margin:0 0 32px;\">\n  <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/07\/thumb-cc-vba-array-init.jpg\" alt=\"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u914d\u5217\u306e\u521d\u671f\u5316\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cReDim\u30fbPreserve\u30fbArray\u30fbErase\u3092\u696d\u52d9\u3067\u5fb9\u5e95\u89e3\u8aac\" style=\"width:100%;height:auto;border-radius:12px;display:block;\">\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-radius:12px;padding:24px 28px;margin:0 0 32px;border-left:4px solid #dc2626;\">\n  <p style=\"font-size:15px;font-weight:700;color:#1a1a1a;margin:0 0 16px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9<\/p>\n  <ol style=\"margin:0;padding-left:20px;font-size:14px;line-height:2.2;list-style:none;\">\n    <li><a href=\"#sec-01\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">01<\/span>VBA\u306e\u914d\u5217\u3068\u306f\u4f55\u304b\u2015\u2015\u696d\u52d9\u8996\u70b9\u3067\u62bc\u3055\u3048\u308b\u57fa\u790e<\/a><\/li>\n    <li><a href=\"#sec-02\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">02<\/span>\u56fa\u5b9a\u9577\u914d\u5217\u3068\u53ef\u5909\u9577\u914d\u5217\u306e\u5ba3\u8a00\u65b9\u6cd5<\/a><\/li>\n    <li><a href=\"#sec-03\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">03<\/span>Erase\u3067\u914d\u5217\u3092\u521d\u671f\u5316\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-04\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">04<\/span>Array\u95a2\u6570\u3067\u914d\u5217\u3092\u521d\u671f\u5316\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-05\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">05<\/span>ReDim\u3067\u8981\u7d20\u6570\u3092\u5909\u66f4\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-06\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">06<\/span>ReDim Preserve\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-07\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">07<\/span>\u591a\u6b21\u5143\u914d\u5217\u306e\u521d\u671f\u5316\u3068\u696d\u52d9\u6d3b\u7528<\/a><\/li>\n    <li><a href=\"#sec-08\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">08<\/span>\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5<\/a><\/li>\n    <li><a href=\"#sec-09\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">09<\/span>Claude Code\u3067VBA\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b<\/a><\/li>\n    <li><a href=\"#sec-10\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">10<\/span>\u307e\u3068\u3081<\/a><\/li>\n    <li><a href=\"#faq\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">FAQ<\/span>\u3088\u304f\u3042\u308b\u8cea\u554f<\/a><\/li>\n  <\/ol>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cVBA\u306e\u914d\u5217\u3067\u521d\u671f\u5316\u304c\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u300d\u300cReDim\u3068Erase\u306e\u9055\u3044\u304c\u5206\u304b\u3089\u306a\u3044\u300d\u2014\u2014Excel\u30de\u30af\u30ed\u3092\u66f8\u304d\u59cb\u3081\u308b\u3068\u3001\u3053\u3046\u3057\u305f\u58c1\u306b\u65e9\u3044\u6bb5\u968e\u3067\u3076\u3064\u304b\u308a\u307e\u3059\u3002\u914d\u5217\uff08\u306f\u3044\u308c\u3064\uff09\u306f\u3001VBA\u3067\u696d\u52d9\u81ea\u52d5\u5316\u3092\u672c\u683c\u7684\u306b\u9032\u3081\u308b\u3068\u304d\u306b\u907f\u3051\u3066\u901a\u308c\u306a\u3044\u6982\u5ff5\u3067\u3042\u308a\u3001\u7279\u306b\u300c\u521d\u671f\u5316\u300d\u306e\u64cd\u4f5c\u306f\u8907\u6570\u306e\u65b9\u6cd5\u304c\u3042\u3063\u3066\u6df7\u4e71\u3057\u3084\u3059\u3044\u30dd\u30a4\u30f3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u914d\u5217\u306e\u521d\u671f\u5316\u65b9\u6cd5\u3092<strong>Erase\u30fbArray\u95a2\u6570\u30fbReDim\u30fbReDim Preserve<\/strong>\u306e4\u7a2e\u985e\u3059\u3079\u3066\u306b\u3064\u3044\u3066\u3001\u52d5\u4f5c\u306e\u9055\u3044\u304b\u3089\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u4f8b\u3001\u696d\u52d9\u3067\u306e\u4f7f\u3044\u3069\u3053\u308d\u307e\u3067\u4f53\u7cfb\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u300c\u914d\u5217\u306f\u4f55\u3068\u306a\u304f\u5206\u304b\u308b\u304c\u3001\u521d\u671f\u5316\u3067\u8a70\u307e\u308b\u300d\u3068\u3044\u3046\u65b9\u304b\u3089\u3001\u300c\u914d\u5217\u3092\u4f7f\u3063\u3066\u696d\u52d9Excel\u3092\u3082\u3063\u3068\u901f\u304f\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u65b9\u307e\u3067\u3001\u8aad\u307f\u7d42\u308f\u308b\u3068\u81ea\u4fe1\u3092\u6301\u3063\u3066\u914d\u5217\u3092\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u3067\u306f\u793e\u5185\u306e\u5728\u5eab\u7ba1\u7406\u30fb\u58f2\u4e0a\u96c6\u8a08\u30fb\u9867\u5ba2\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306a\u3069\u3001\u3042\u3089\u3086\u308bExcel\u696d\u52d9\u30de\u30af\u30ed\u3092\u958b\u767a\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u4e2d\u3067\u914d\u5217\u3092\u6b63\u3057\u304f\u521d\u671f\u5316\u3067\u304d\u306a\u3044\u30b3\u30fc\u30c9\u304c\u539f\u56e0\u306e\u30c8\u30e9\u30d6\u30eb\u304c\u591a\u304b\u3063\u305f\u3002\u3053\u306e\u8a18\u4e8b\u3067\u4e00\u6c17\u306b\u6574\u7406\u3057\u3066\u3044\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300c\u914d\u5217\u306e\u521d\u671f\u5316\u300d\u306f\u5965\u304c\u6df1\u3044\u30c6\u30fc\u30de\u3067\u3059\u3002Erase\u3068ReDim\u3092\u6df7\u540c\u3059\u308b\u3060\u3051\u3067\u5168\u304f\u9055\u3046\u52d5\u4f5c\u306b\u306a\u308a\u307e\u3059\u3002\u4eca\u65e5\u306f\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u9055\u3044\u3082\u542b\u3081\u3066\u3001\u8ff7\u308f\u305a\u4f7f\u3048\u308b\u30ec\u30d9\u30eb\u306b\u6574\u7406\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u5206\u304b\u308b\u3053\u3068\u3092\u307e\u3068\u3081\u308b\u3068\u3001\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u914d\u5217\u306e\u57fa\u672c\u6982\u5ff5<\/strong>\uff1a\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u9055\u3044\u3068\u3001\u3069\u3061\u3089\u3092\u9078\u3076\u3079\u304d\u304b\u306e\u5224\u65ad\u57fa\u6e96<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Erase<\/strong>\uff1a\u56fa\u5b9a\u9577\u3068\u53ef\u5909\u9577\u3067\u52d5\u4f5c\u304c\u7570\u306a\u308b\u521d\u671f\u5316\u547d\u4ee4\u306e\u5b8c\u5168\u89e3\u8aac<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Array\u95a2\u6570<\/strong>\uff1a\u5024\u3092\u4e00\u62ec\u4ee3\u5165\u3067\u304d\u308b\u521d\u671f\u5316\u306e\u66f8\u304d\u65b9\u3068\u6ce8\u610f\u70b9\uff08Variant\u578b\u5fc5\u9808\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>ReDim<\/strong>\uff1a\u5b9f\u884c\u6642\u306b\u8981\u7d20\u6570\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u3068\u300c\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u308b\u300d\u6319\u52d5<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>ReDim Preserve<\/strong>\uff1a\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3059\u308b\u65b9\u6cd5\u3068\u591a\u6b21\u5143\u914d\u5217\u306e\u5236\u7d04<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u696d\u52d9\u3067\u306e\u6d3b\u7528\u30d1\u30bf\u30fc\u30f3<\/strong>\uff1aExcel\u30b7\u30fc\u30c8\u3068\u306e\u9ad8\u901f\u30c7\u30fc\u30bf\u5165\u51fa\u529b\u306e\u5b9f\u8df5\u30c6\u30af\u30cb\u30c3\u30af<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5<\/strong>\uff1a\u30a8\u30e9\u30fc\u756a\u53f79\u30fb13\u306e\u6839\u672c\u539f\u56e0<\/span><\/div>\n\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-01\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">01<\/span>\n  <span class=\"section-label\" style=\"display:block;\">VBA BASICS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">VBA\u306e\u914d\u5217\u3068\u306f\u4f55\u304b\u2015\u2015\u696d\u52d9\u8996\u70b9\u3067\u62bc\u3055\u3048\u308b\u57fa\u790e<\/span>\n  <span class=\"section-desc\">\u5909\u6570\u3068\u306e\u9055\u3044\u3001\u914d\u5217\u304c\u5fc5\u8981\u306b\u306a\u308b\u5834\u9762\u3001\u30e1\u30e2\u30ea\u4e0a\u306e\u4ed5\u7d44\u307f\u3092\u6574\u7406\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u304a\u3051\u308b\u300c\u914d\u5217\u300d\u3068\u306f\u3001\u540c\u3058\u30c7\u30fc\u30bf\u578b\u306e\u8907\u6570\u306e\u5024\u3092\u9023\u7d9a\u3057\u305f\u30e1\u30e2\u30ea\u9818\u57df\u306b\u307e\u3068\u3081\u3066\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u306e\u3053\u3068\u3067\u3059\u3002\u96e3\u3057\u304f\u805e\u3053\u3048\u307e\u3059\u304c\u3001Excel\u3067\u4f8b\u3048\u308b\u3068\u300c1\u3064\u306e\u30bb\u30eb\uff1d1\u3064\u306e\u5909\u6570\u3001\u30bb\u30eb\u304c\u307e\u3068\u307e\u3063\u305f\u884c\u30fb\u5217\uff1d\u914d\u5217\u300d\u3068\u3044\u3046\u30a4\u30e1\u30fc\u30b8\u304c\u8fd1\u3044\u3067\u3059\u3002\u793e\u54e110\u540d\u306e\u7d66\u4e0e\u3092\u7ba1\u7406\u3059\u308b\u3068\u304d\u3001salary1, salary2, salary3\u2026\u3068\u3044\u304610\u500b\u306e\u5909\u6570\u3092\u5225\u3005\u306b\u4f5c\u308b\u3088\u308a\u3001salaries(0)\u301csalaries(9)\u3068\u3044\u3046\u914d\u52171\u3064\u3067\u7ba1\u7406\u3059\u308b\u307b\u3046\u304c\u30b3\u30fc\u30c9\u304c\u5727\u5012\u7684\u306b\u30b7\u30f3\u30d7\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u914d\u5217\uff08\u306f\u3044\u308c\u3064\uff09<\/strong>\uff1a\u540c\u3058\u30c7\u30fc\u30bf\u578b\u306e\u8907\u6570\u306e\u5024\u3092\u9023\u7d9a\u3057\u305f\u30e1\u30e2\u30ea\u9818\u57df\u306b\u683c\u7d0d\u3059\u308b\u30c7\u30fc\u30bf\u69cb\u9020\u3002VBA\u3067\u306f\u300cDim arr(9) As Integer\u300d\u306e\u3088\u3046\u306b\u5ba3\u8a00\u3057\u3001arr(0)\u301carr(9)\u306e10\u500b\u306e\u8981\u7d20\u3092\u4e00\u62ec\u7ba1\u7406\u3057\u307e\u3059\u3002\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u9ad8\u901f\u306b\u4e00\u62ec\u64cd\u4f5c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u5217\u304c\u7279\u306b\u5a01\u529b\u3092\u767a\u63ee\u3059\u308b\u306e\u306f\u3001\u300c\u7e70\u308a\u8fd4\u3057\u51e6\u7406\uff08For\u6587\uff09\u300d\u3068\u7d44\u307f\u5408\u308f\u305b\u305f\u3068\u304d\u3067\u3059\u3002\u305f\u3068\u3048\u3070100\u4ef6\u306e\u9867\u5ba2\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u30671\u4ef6\u305a\u3064\u51e6\u7406\u3059\u308b\u3068\u304d\u3001\u5909\u6570\u304c100\u500b\u3042\u308b\u3068100\u884c\u306e\u30b3\u30fc\u30c9\u304c\u5fc5\u8981\u3067\u3059\u304c\u3001\u914d\u5217\u306a\u3089\u300cFor i = 0 To 99\u300d\u306e1\u3064\u306e\u30eb\u30fc\u30d7\u3067\u51e6\u7406\u3067\u304d\u307e\u3059\u3002\u30b3\u30fc\u30c9\u304c\u77ed\u304f\u306a\u308b\u3060\u3051\u3067\u306a\u304f\u3001\u4ef6\u6570\u304c\u5909\u308f\u3063\u3066\u3082\u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u6761\u4ef6\u3092\u5909\u3048\u308b\u3060\u3051\u3067\u5bfe\u5fdc\u3067\u304d\u308b\u305f\u3081\u3001\u4fdd\u5b88\u6027\u3082\u683c\u6bb5\u306b\u4e0a\u304c\u308a\u307e\u3059\u3002\u3053\u308c\u304c\u914d\u5217\u3092\u4f7f\u3046\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u914d\u5217\u306b\u306f\u5927\u304d\u304f\u5206\u3051\u30662\u7a2e\u985e\u3042\u308a\u307e\u3059\u3002\u5ba3\u8a00\u6642\u306b\u8981\u7d20\u6570\u3092\u6c7a\u3081\u308b\u300c\u56fa\u5b9a\u9577\u914d\u5217\u300d\u3068\u3001\u5b9f\u884c\u4e2d\u306b\u8981\u7d20\u6570\u3092\u5909\u66f4\u3067\u304d\u308b\u300c\u53ef\u5909\u9577\u914d\u5217\u300d\u3067\u3059\u3002\u3069\u3061\u3089\u3092\u9078\u3076\u304b\u306f\u300c\u51e6\u7406\u3059\u308b\u30c7\u30fc\u30bf\u306e\u4ef6\u6570\u304c\u4e8b\u524d\u306b\u5206\u304b\u308b\u304b\u3069\u3046\u304b\u300d\u3067\u5224\u65ad\u3057\u307e\u3059\u3002\u6708\u6b21\u306e\u58f2\u4e0a\u30c7\u30fc\u30bf\u304c\u5e38\u306b12\u30f6\u6708\u5206\u3067\u3042\u308c\u3070\u56fa\u5b9a\u9577\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3059\u308b\u30ec\u30b3\u30fc\u30c9\u6570\u304c\u6bce\u56de\u5909\u308f\u308b\u306a\u3089\u53ef\u5909\u9577\u304c\u9069\u5207\u3067\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u3001\u305d\u308c\u305e\u308c\u306e\u5ba3\u8a00\u65b9\u6cd5\u3092\u5177\u4f53\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>Excel\u306e\u30bb\u30eb\u7bc4\u56f2\u30c7\u30fc\u30bf\u3092VBA\u3067\u4e00\u62ec\u51e6\u7406\u3057\u305f\u3044<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u9867\u5ba2\u30ea\u30b9\u30c8\u3084\u5546\u54c1\u30ea\u30b9\u30c8\u3092\u30eb\u30fc\u30d7\u3067\u51e6\u7406\u3059\u308b\u30de\u30af\u30ed\u3092\u66f8\u304d\u305f\u3044<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>ReDim\u3084Erase\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306b\u601d\u3044\u901a\u308a\u306b\u52d5\u304b\u306a\u3044<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u56fa\u5b9a\u9577\u914d\u5217\u3068\u53ef\u5909\u9577\u914d\u5217\u306e\u4f7f\u3044\u5206\u3051\u3067\u8ff7\u3063\u3066\u3044\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>2\u6b21\u5143\u914d\u5217\u3067Excel\u30b7\u30fc\u30c8\u3092\u9ad8\u901f\u306b\u64cd\u4f5c\u3057\u305f\u3044<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u914d\u5217\u3092\u899a\u3048\u308b\u3068\u300c1\u4ef6\u305a\u3064\u30bb\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u30de\u30af\u30ed\u300d\u304b\u3089\u300c\u307e\u3068\u3081\u3066\u914d\u5217\u306b\u8aad\u307f\u8fbc\u3093\u3067\u51e6\u7406\u3057\u3066\u307e\u3068\u3081\u3066\u66f8\u304d\u51fa\u3059\u300d\u3068\u3044\u3046\u9ad8\u901f\u30d1\u30bf\u30fc\u30f3\u306b\u79fb\u884c\u3067\u304d\u307e\u3059\u3002\u51e6\u7406\u6642\u9593\u304c\u6587\u5b57\u901a\u308a10\u301c100\u500d\u901f\u304f\u306a\u308b\u30b1\u30fc\u30b9\u306f\u73cd\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-02\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">02<\/span>\n  <span class=\"section-label\" style=\"display:block;\">ARRAY DECLARATION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u56fa\u5b9a\u9577\u914d\u5217\u3068\u53ef\u5909\u9577\u914d\u5217\u306e\u5ba3\u8a00\u65b9\u6cd5<\/span>\n  <span class=\"section-desc\">\u5ba3\u8a00\u306e\u69cb\u6587\u30fb\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u57fa\u672c\u30fb\u30b9\u30b3\u30fc\u30d7\u306e\u8003\u3048\u65b9\u3092\u62bc\u3055\u3048\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u5217\u3092\u4f7f\u3046\u306b\u306f\u3001\u307e\u305a\u300c\u5ba3\u8a00\u300d\u304c\u5fc5\u8981\u3067\u3059\u3002VBA\u3067\u306f\u5909\u6570\u3068\u540c\u69d8\u306b\u3001\u4f7f\u3046\u524d\u306b\u300c\u3053\u306e\u540d\u524d\u3067\u3053\u306e\u578b\u306e\u914d\u5217\u3092\u4f7f\u3044\u307e\u3059\u300d\u3068\u5ba3\u8a00\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u5ba3\u8a00\u306e\u4ed5\u65b9\u306b\u3088\u3063\u3066\u56fa\u5b9a\u9577\u304b\u53ef\u5909\u9577\u304b\u304c\u6c7a\u307e\u308a\u3001\u305d\u306e\u5f8c\u306e\u64cd\u4f5c\uff08Erase\u30fbReDim\u30fbArray\u95a2\u6570\uff09\u3082\u5ba3\u8a00\u306e\u7a2e\u985e\u306b\u3088\u3063\u3066\u4f7f\u3048\u308b\u3082\u306e\u30fb\u4f7f\u3048\u306a\u3044\u3082\u306e\u304c\u5909\u308f\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2-1. \u56fa\u5b9a\u9577\u914d\u5217\u306e\u5ba3\u8a00<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u56fa\u5b9a\u9577\u914d\u5217\u306f\u3001\u5ba3\u8a00\u6642\u306b\u8981\u7d20\u6570\u3092\u62ec\u5f27\u5185\u306b\u6570\u5024\u3067\u6307\u5b9a\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u300cDim scores(9) As Integer\u300d\u3068\u66f8\u304f\u3068\u3001scores(0)\u301cscores(9)\u306e10\u8981\u7d20\u3092\u6301\u3064Integer\u578b\u306e\u914d\u5217\u304c\u4f5c\u3089\u308c\u307e\u3059\u3002\u8981\u7d20\u6570\u306f\u300c\u6700\u5927\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u300d\u3092\u6307\u5b9a\u3059\u308b\u70b9\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002scores(9)\u306f\u300c0\u304b\u3089\u59cb\u307e\u3063\u30669\u756a\u76ee\u307e\u3067\u300d\u306a\u306e\u306710\u8981\u7d20\u306b\u306a\u308a\u307e\u3059\u3002\u5ba3\u8a00\u6642\u304b\u3089\u30e1\u30e2\u30ea\u306b\u9818\u57df\u304c\u78ba\u4fdd\u3055\u308c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u4e2d\u306b\u8981\u7d20\u6570\u3092\u5909\u3048\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u56fa\u5b9a\u9577\u914d\u5217\u306e\u5ba3\u8a00\u4f8b\nDim scores(9) As Integer        &#x27; 10\u8981\u7d20\uff08scores(0)\u301cscores(9)\uff09\nDim names(4) As String          &#x27; 5\u8981\u7d20\uff08names(0)\u301cnames(4)\uff09\nDim prices(11) As Double        &#x27; 12\u8981\u7d20\uff08\u6708\u5225\u30c7\u30fc\u30bf 12\u30f6\u6708\u5206\uff09\n\n&#x27; \u5ba3\u8a00\u3068\u540c\u6642\u306b\u5024\u3092\u683c\u7d0d\u3059\u308b\u4f8b\nDim monthlyBudget(11) As Long\nDim i As Integer\nFor i = 0 To 11\n    monthlyBudget(i) = 100000  &#x27; \u5168\u6708100,000\u5186\u3067\u521d\u671f\u5316\nNext i<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u56fa\u5b9a\u9577\u914d\u5217<\/strong>\uff1a\u5ba3\u8a00\u6642\u306b\u8981\u7d20\u6570\u3092\u6307\u5b9a\u3059\u308b\u914d\u5217\u3002Dim arr(9) As Integer\u3068\u3059\u308b\u3068\u3001arr(0)\u301carr(9)\u306e10\u8981\u7d20\u304c\u78ba\u4fdd\u3055\u308c\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u4e2d\u306b\u8981\u7d20\u6570\u3092\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u4e8b\u524d\u306b\u78ba\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u56fa\u5b9a\u9577\u914d\u5217\u306bReDim\u3092\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2-2. \u53ef\u5909\u9577\u914d\u5217\u306e\u5ba3\u8a00<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u5909\u9577\u914d\u5217\u306f\u3001\u5ba3\u8a00\u6642\u306e\u62ec\u5f27\u5185\u3092\u7a7a\u306b\u3057\u3066\u8981\u7d20\u6570\u3092\u7701\u7565\u3057\u307e\u3059\u3002\u300cDim arr() As String\u300d\u306e\u3088\u3046\u306b\u66f8\u304f\u3068\u3001\u305d\u306e\u6642\u70b9\u3067\u306f\u30e1\u30e2\u30ea\u304c\u78ba\u4fdd\u3055\u308c\u305a\u3001\u5f8c\u304b\u3089ReDim\u547d\u4ee4\u3067\u8981\u7d20\u6570\u3092\u6307\u5b9a\u3057\u3066\u521d\u3081\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u524d\u306b\u78ba\u5b9a\u3057\u306a\u3044\u5834\u5408\u2014\u2014\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30af\u30a8\u30ea\u7d50\u679c\u4ef6\u6570\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u884c\u6570\u306a\u3069\u2014\u2014\u306b\u5fc5\u305a\u4f7f\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u53ef\u5909\u9577\u914d\u5217\u306e\u5ba3\u8a00\u4f8b\nDim customerNames() As String   &#x27; \u5ba3\u8a00\u6642\u306f\u8981\u7d20\u6570\u306a\u3057\nDim salesData() As Double        &#x27; \u5ba3\u8a00\u6642\u306f\u8981\u7d20\u6570\u306a\u3057\n\n&#x27; \u5f8c\u3067ReDim\u3067\u8981\u7d20\u6570\u3092\u6307\u5b9a\u3057\u3066\u4f7f\u3046\nDim recordCount As Long\nrecordCount = 500  &#x27; \u5b9f\u884c\u6642\u306b\u4ef6\u6570\u304c\u78ba\u5b9a\nReDim customerNames(recordCount - 1)  &#x27; 0\u301c499\u306e500\u8981\u7d20\u3092\u78ba\u4fdd\nReDim salesData(recordCount - 1)\n\n&#x27; \u4ee5\u964d\u306f\u56fa\u5b9a\u9577\u914d\u5217\u3068\u540c\u69d8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\ncustomerNames(0) = &quot;\u7530\u4e2d\u5546\u4e8b\u682a\u5f0f\u4f1a\u793e&quot;\nsalesData(0) = 1250000<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u53ef\u5909\u9577\u914d\u5217<\/strong>\uff1a\u5ba3\u8a00\u6642\u306b\u8981\u7d20\u6570\u3092\u6307\u5b9a\u305b\u305a\u3001\u5b9f\u884c\u6642\u306bReDim\u3067\u52d5\u7684\u306b\u5909\u66f4\u3067\u304d\u308b\u914d\u5217\u3002Dim arr() As String\u306e\u3088\u3046\u306b\u62ec\u5f27\u5185\u3092\u7a7a\u306b\u3057\u3066\u5ba3\u8a00\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u4e8b\u524d\u306b\u4e0d\u660e\u306a\u5834\u5408\u3084\u3001\u51e6\u7406\u4e2d\u306b\u4ef6\u6570\u304c\u5909\u308f\u308b\u5834\u5408\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u8aa4\u3063\u3066\u56fa\u5b9a\u9577\u3068\u3057\u3066\u5ba3\u8a00\u3059\u308b\u3068ReDim\u304c\u3067\u304d\u306a\u304f\u306a\u308b\u305f\u3081\u3001\u8a2d\u8a08\u6bb5\u968e\u3067\u3069\u3061\u3089\u3092\u4f7f\u3046\u304b\u6c7a\u3081\u3066\u304a\u304f\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2-3. \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u57fa\u672c\u3068Option Base<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u3067\u306f\u914d\u5217\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u6dfb\u3048\u5b57\uff09\u306f\u6a19\u6e96\u3067\u300c0\u59cb\u307e\u308a\u300d\u3067\u3059\u3002Dim arr(9) As Integer\u306a\u3089\u8981\u7d20\u306farr(0)\u301carr(9)\u306e10\u500b\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u3092\u300c1\u59cb\u307e\u308a\u300d\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5148\u982d\u306b\u300cOption Base 1\u300d\u3068\u8a18\u8ff0\u3057\u307e\u3059\u3002\u3059\u308b\u3068\u300cDim arr(9) As Integer\u300d\u306farr(1)\u301carr(9)\u306e9\u8981\u7d20\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3057Option Base 1\u306f\u540c\u4e00\u30e2\u30b8\u30e5\u30fc\u30eb\u5185\u306e\u3059\u3079\u3066\u306e\u914d\u5217\u306b\u5f71\u97ff\u3059\u308b\u305f\u3081\u3001\u6df7\u4e71\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u3082\u300c0\u59cb\u307e\u308a\u3067\u7d71\u4e00\u300d\u3057\u3001\u8981\u7d20\u6570\u3092\u8a08\u7b97\u3059\u308b\u3068\u304d\u306bLBound()\u30fbUBound()\u95a2\u6570\u3092\u4f7f\u3046\u65b9\u304c\u5b89\u5168\u306a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30b9\u30bf\u30a4\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">LBound\u30fbUBound\u3067\u5b89\u5168\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3059\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">For i = 0 To 9 \u3068\u6c7a\u3081\u6253\u3061\u3059\u308b\u3088\u308a\u3001For i = LBound(arr) To UBound(arr) \u3068\u66f8\u304f\u7fd2\u6163\u3092\u3064\u3051\u308b\u3068\u3001Option Base \u306e\u8a2d\u5b9a\u5909\u66f4\u3084ReDim\u3067\u8981\u7d20\u6570\u304c\u5909\u308f\u3063\u305f\u969b\u3082\u30b3\u30fc\u30c9\u3092\u76f4\u3055\u305a\u306b\u6e08\u307f\u307e\u3059\u3002\u7279\u306bReDim Preserve\u3067\u7e70\u308a\u8fd4\u3057\u62e1\u5f35\u3059\u308b\u51e6\u7406\u3067\u306f\u3001UBound(arr)\u3067\u306e\u307f\u6b63\u78ba\u306a\u4ef6\u6570\u304c\u5206\u304b\u308b\u305f\u3081\u5fc5\u9808\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u5ba3\u8a00<\/strong><br><span style=\"font-size:12px;\">Dim arr(N) As\u578b<br>or Dim arr() As\u578b<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u521d\u671f\u5316\/\u78ba\u4fdd<\/strong><br><span style=\"font-size:12px;\">ReDim\uff08\u53ef\u5909\u9577\uff09<br>or \u5ba3\u8a00\u6642\u306b\u78ba\u4fdd\uff08\u56fa\u5b9a\uff09<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30c7\u30fc\u30bf\u683c\u7d0d<\/strong><br><span style=\"font-size:12px;\">arr(i) = \u5024<br>\u30eb\u30fc\u30d7\u3067\u4e00\u62ec\u4ee3\u5165<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u51e6\u7406<\/strong><br><span style=\"font-size:12px;\">\u30eb\u30fc\u30d7\u30fb\u96c6\u8a08<br>\u30d5\u30a3\u30eb\u30bf\u30fb\u5909\u63db<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u518d\u521d\u671f\u5316\/\u89e3\u653e<\/strong><br><span style=\"font-size:12px;\">Erase or ReDim<br>\u3067\u6b21\u56de\u306b\u5099\u3048\u308b<\/span><\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300c\u56fa\u5b9a\u9577\u304b\u53ef\u5909\u9577\u304b\u300d\u306e\u5224\u65ad\u3067\u8ff7\u3063\u305f\u3089\u3001\u307e\u305a\u300c\u4ef6\u6570\u304c\u5b9f\u884c\u524d\u306b\u6c7a\u307e\u308b\u304b\u300d\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002Excel\u306e\u30b7\u30fc\u30c8\u884c\u6570\u3084DB\u306e\u30af\u30a8\u30ea\u4ef6\u6570\u306e\u3088\u3046\u306b\u6bce\u56de\u5909\u308f\u308b\u3082\u306e\u306f\u53ef\u5909\u9577\u4e00\u629e\u3002\u56fa\u5b9a\u9577\u3092\u4f7f\u3063\u3066\u5f8c\u304b\u3089ReDim\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u306e\u3067\u6c17\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-03\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">03<\/span>\n  <span class=\"section-label\" style=\"display:block;\">ERASE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Erase\u3067\u914d\u5217\u3092\u521d\u671f\u5316\u3059\u308b<\/span>\n  <span class=\"section-desc\">\u56fa\u5b9a\u9577\u3068\u53ef\u5909\u9577\u3067\u6319\u52d5\u304c\u5909\u308f\u308b\u300c\u4e00\u62ec\u30ea\u30bb\u30c3\u30c8\u300d\u547d\u4ee4\u306e\u5b8c\u5168\u89e3\u8aac<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Erase\u306f\u914d\u5217\u306e\u5168\u8981\u7d20\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u305f\u3081\u306eVBA\u547d\u4ee4\u3067\u3059\u3002\u69cb\u6587\u306f\u300cErase \u914d\u5217\u540d\u300d\u3068\u975e\u5e38\u306b\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u304c\u3001<strong>\u56fa\u5b9a\u9577\u914d\u5217\u3068\u53ef\u5909\u9577\u914d\u5217\u3067\u52d5\u4f5c\u304c\u5168\u304f\u7570\u306a\u308b<\/strong>\u305f\u3081\u3001\u3053\u306e\u9055\u3044\u3092\u6b63\u78ba\u306b\u7406\u89e3\u3057\u3066\u3044\u306a\u3044\u3068\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u306a\u308a\u307e\u3059\u3002VBA\u306e\u30a8\u30e9\u30fc\u3067\u6700\u3082\u591a\u3044\u300c\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\uff08\u30a8\u30e9\u30fc\u756a\u53f79\uff09\u300d\u306e\u539f\u56e0\u306e\u591a\u304f\u304c\u3001\u3053\u306eErase\u306e\u8aa4\u3063\u305f\u4f7f\u7528\u304b\u3089\u751f\u3058\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3-1. \u56fa\u5b9a\u9577\u914d\u5217\u3078\u306eErase\uff1a\u5168\u8981\u7d20\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u30ea\u30bb\u30c3\u30c8<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u56fa\u5b9a\u9577\u914d\u5217\u306bErase\u3092\u4f7f\u3046\u3068\u3001\u5168\u8981\u7d20\u304c\u305d\u306e\u30c7\u30fc\u30bf\u578b\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff08Integer\u30fbLong\u30fbDouble\u306a\u3069\u306e\u6570\u5024\u578b\u306f0\u3001String\u578b\u306f\u7a7a\u6587\u5b57\"\"\u3001Boolean\u578b\u306fFalse\u3001Date\u578b\u306f1899\/12\/30\uff09\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002\u914d\u5217\u306e\u30b5\u30a4\u30ba\uff08\u8981\u7d20\u6570\uff09\u306f\u305d\u306e\u307e\u307e\u7dad\u6301\u3055\u308c\u308b\u305f\u3081\u3001Erase\u5f8c\u3082arr(0)\u301carr(N)\u306b\u5f15\u304d\u7d9a\u304d\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002\u300c\u9031\u6b21\u306e\u96c6\u8a08\u5024\u3092\u6708\u672b\u306b\u5168\u4ef6\u30af\u30ea\u30a2\u3057\u3066\u7fcc\u6708\u306e\u30c7\u30fc\u30bf\u5165\u529b\u306b\u5099\u3048\u308b\u300d\u3068\u3044\u3063\u305f\u7528\u9014\u306b\u6700\u9069\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u56fa\u5b9a\u9577\u914d\u5217\u306eErase\u4f8b\nDim scores(4) As Integer\nscores(0) = 85: scores(1) = 92: scores(2) = 78\nscores(3) = 88: scores(4) = 95\n\nDebug.Print scores(0)  &#x27; \u2192 85\n\nErase scores  &#x27; \u5168\u8981\u7d20\u3092\u30ea\u30bb\u30c3\u30c8\n\nDebug.Print scores(0)  &#x27; \u2192 0\uff08\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u305f\uff09\nDebug.Print scores(4)  &#x27; \u2192 0\uff08\u8981\u7d20\u6570\u306f\u7dad\u6301\u3055\u308c\u3066\u3044\u308b\uff09\n\n&#x27; Erase\u5f8c\u3082\u540c\u3058\u30b5\u30a4\u30ba\u3067\u5f15\u304d\u7d9a\u304d\u4f7f\u3048\u308b\nscores(0) = 70\nDebug.Print scores(0)  &#x27; \u2192 70<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3-2. \u53ef\u5909\u9577\u914d\u5217\u3078\u306eErase\uff1a\u30e1\u30e2\u30ea\u304c\u5b8c\u5168\u306b\u89e3\u653e\u3055\u308c\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u5909\u9577\u914d\u5217\u306bErase\u3092\u4f7f\u3046\u3068\u3001\u914d\u5217\u306e\u30e1\u30e2\u30ea\u304c<strong>\u5b8c\u5168\u306b\u89e3\u653e<\/strong>\u3055\u308c\u307e\u3059\u3002\u56fa\u5b9a\u9577\u306e\u3088\u3046\u306b\u300c\u5168\u8981\u7d20\u304c0\u306b\u306a\u3063\u3066\u30b5\u30a4\u30ba\u306f\u7dad\u6301\u300d\u3067\u306f\u306a\u304f\u3001\u300c\u914d\u5217\u305d\u306e\u3082\u306e\u304c\u306a\u304b\u3063\u305f\u3053\u3068\u306b\u306a\u308b\u300d\u30a4\u30e1\u30fc\u30b8\u3067\u3059\u3002Erase\u5f8c\u306barr(0)\u306a\u3069\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u300c\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\uff08\u30a8\u30e9\u30fc\u756a\u53f79\uff09\u300d\u304c\u5373\u5ea7\u306b\u767a\u751f\u3057\u307e\u3059\u3002\u53ef\u5909\u9577\u914d\u5217\u3067Erase\u3092\u4f7f\u3063\u305f\u5f8c\u306f\u3001\u5fc5\u305aReDim\u3067\u518d\u5ea6\u8981\u7d20\u6570\u3092\u8a2d\u5b9a\u3057\u3066\u304b\u3089\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u53ef\u5909\u9577\u914d\u5217\u306eErase\u4f8b\uff08\u6ce8\u610f\u304c\u5fc5\u8981\uff09\nDim names() As String\nReDim names(4)  &#x27; 5\u8981\u7d20\u3092\u78ba\u4fdd\nnames(0) = &quot;\u7530\u4e2d&quot;: names(1) = &quot;\u4f50\u85e4&quot;: names(2) = &quot;\u5c71\u7530&quot;\n\nDebug.Print names(0)  &#x27; \u2192 \u7530\u4e2d\n\nErase names  &#x27; \u30e1\u30e2\u30ea\u304c\u5b8c\u5168\u306b\u89e3\u653e\u3055\u308c\u308b\n\n&#x27; \u3053\u3053\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30a8\u30e9\u30fc\uff01\n&#x27; Debug.Print names(0)  &#x27; \u2192 \u30a8\u30e9\u30fc9: \u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\n\n&#x27; Erase\u5f8c\u306b\u518d\u5229\u7528\u3059\u308b\u306b\u306fReDim\u304c\u5fc5\u8981\nReDim names(9)  &#x27; 10\u8981\u7d20\u3067\u518d\u78ba\u4fdd\nnames(0) = &quot;\u9234\u6728&quot;  &#x27; OK<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">Erase\u4f7f\u7528\u6642\u306e\u6700\u91cd\u8981\u6ce8\u610f\uff1a\u53ef\u5909\u9577\u914d\u5217\u306f\u30e1\u30e2\u30ea\u89e3\u653e\u3055\u308c\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u53ef\u5909\u9577\u914d\u5217\uff08Dim arr() As String\uff09\u306bErase\u3092\u4f7f\u3046\u3068\u3001\u914d\u5217\u306e\u30e1\u30e2\u30ea\u304c\u5b8c\u5168\u306b\u89e3\u653e\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u5f8carr(0)\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u300c\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\uff08\u30a8\u30e9\u30fc\u756a\u53f79\uff09\u300d\u304c\u767a\u751f\u3057\u307e\u3059\u3002Erase\u5f8c\u306f\u5fc5\u305aReDim\u3067\u518d\u521d\u671f\u5316\u3057\u3066\u304b\u3089\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306fVBA\u306e\u30d0\u30b0\u3067\u6700\u3082\u3088\u304f\u898b\u304b\u3051\u308b\u539f\u56e0\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3-3. \u30c7\u30fc\u30bf\u578b\u5225\u306eErase\u5f8c\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/h3>\n\n\n\n<table>\n<thead><tr><th>\u30c7\u30fc\u30bf\u578b<\/th><th>Erase\u5f8c\u306e\u5024<\/th><th>\u7528\u9014\u306e\u76ee\u5b89<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Integer \/ Long \/ Double<\/td><td>0\uff08\u30bc\u30ed\uff09<\/td><td>\u6570\u5024\u96c6\u8a08\u7528\u914d\u5217\u306e\u30ea\u30bb\u30c3\u30c8<\/td><\/tr>\n<tr><td>String<\/td><td>\"\"\uff08\u7a7a\u6587\u5b57\uff09<\/td><td>\u6c0f\u540d\u30fb\u30b3\u30fc\u30c9\u7b49\u306e\u6587\u5b57\u5217\u914d\u5217\u306e\u30ea\u30bb\u30c3\u30c8<\/td><\/tr>\n<tr><td>Boolean<\/td><td>False<\/td><td>\u30d5\u30e9\u30b0\u7ba1\u7406\u914d\u5217\u306e\u30ea\u30bb\u30c3\u30c8<\/td><\/tr>\n<tr><td>Date<\/td><td>1899\/12\/30<\/td><td>\u65e5\u4ed8\u914d\u5217\u306e\u30ea\u30bb\u30c3\u30c8\uff08\u307b\u307c\u4f7f\u308f\u306a\u3044\uff09<\/td><\/tr>\n<tr><td>Object<\/td><td>Nothing<\/td><td>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u53c2\u7167\u914d\u5217\u306e\u89e3\u653e<\/td><\/tr>\n<tr><td>Variant<\/td><td>Empty<\/td><td>\u578b\u4e0d\u5b9a\u306e\u914d\u5217\u306e\u30ea\u30bb\u30c3\u30c8<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Erase\u306f\u3088\u304fFor\u6587\u3067\u5168\u8981\u7d20\u306b0\u3092\u4ee3\u5165\u3059\u308b\u30b3\u30fc\u30c9\u3068\u6bd4\u8f03\u3055\u308c\u307e\u3059\u3002\u6a5f\u80fd\u7684\u306b\u306f\u540c\u3058\u3067\u3059\u304c\u3001Erase\u306e\u65b9\u304c\u30b3\u30fc\u30c9\u304c\u77ed\u304fVBA\u30e9\u30f3\u30bf\u30a4\u30e0\u5074\u3067\u6700\u9069\u5316\u3055\u308c\u308b\u305f\u3081\u51e6\u7406\u3082\u901f\u3044\u3067\u3059\u3002\u914d\u5217\u3092\u4e00\u62ec\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u3068\u304d\u306f\u8ff7\u308f\u305aErase\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u56fa\u5b9a\u9577\u914d\u5217\u306bErase\u3092\u4f7f\u3046\u3068\uff1a\u5168\u8981\u7d20\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u30ea\u30bb\u30c3\u30c8\u3001\u30b5\u30a4\u30ba\u306f\u7dad\u6301<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u53ef\u5909\u9577\u914d\u5217\u306bErase\u3092\u4f7f\u3046\u3068\uff1a\u30e1\u30e2\u30ea\u5b8c\u5168\u89e3\u653e\u3001Erase\u5f8c\u306fReDim\u304c\u5fc5\u9808<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>String\u578b\u306fErase\u5f8c\u306b\"\"\uff08\u7a7a\u6587\u5b57\uff09\u3001\u6570\u5024\u578b\u306f0\u306b\u306a\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>Erase\u5f8c\u306e\u53ef\u5909\u9577\u914d\u5217\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u30a8\u30e9\u30fc\u756a\u53f79\u304c\u767a\u751f\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u914d\u5217\u3092Erase\u3059\u308b\u3068Nothing\u304c\u4ee3\u5165\u3055\u308c\u3066\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3092\u9632\u3052\u308b<\/span><\/div>\n\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-04\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">04<\/span>\n  <span class=\"section-label\" style=\"display:block;\">ARRAY FUNCTION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Array\u95a2\u6570\u3067\u914d\u5217\u3092\u521d\u671f\u5316\u3059\u308b<\/span>\n  <span class=\"section-desc\">\u8907\u6570\u306e\u5024\u3092\u4e00\u884c\u3067\u4ee3\u5165\u3067\u304d\u308b\u521d\u671f\u5316\u306e\u66f8\u304d\u65b9\u3068\u6ce8\u610f\u70b9<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Array\u95a2\u6570\u306f\u3001\u62ec\u5f27\u5185\u306b\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u5024\u3092\u4e26\u3079\u308b\u3068\u3001\u305d\u308c\u3089\u306e\u5024\u3092\u683c\u7d0d\u3057\u305f\u914d\u5217\u3092\u4e00\u5ea6\u306b\u751f\u6210\u3057\u3066\u8fd4\u3059\u95a2\u6570\u3067\u3059\u3002\u300cDim months As Variant: months = Array(\"1\u6708\", \"2\u6708\", ..., \"12\u6708\")\u300d\u306e\u3088\u3046\u306b\u3001\u5ba3\u8a00\u3068\u4ee3\u5165\u3092\u5b9f\u8cea1\u301c2\u884c\u3067\u66f8\u3051\u308b\u305f\u3081\u3001\u3042\u3089\u304b\u3058\u3081\u5024\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u30de\u30b9\u30bf\u30fc\u30c7\u30fc\u30bf\uff08\u66dc\u65e5\u540d\u30fb\u6708\u540d\u30fb\u90e8\u7f72\u30b3\u30fc\u30c9\u30fb\u30b9\u30c6\u30fc\u30bf\u30b9\u30ea\u30b9\u30c8\u7b49\uff09\u3092\u914d\u5217\u306b\u5165\u308c\u308b\u969b\u306b\u6700\u3082\u4fbf\u5229\u306a\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4-1. Array\u95a2\u6570\u306e\u57fa\u672c\u69cb\u6587<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Array\u95a2\u6570\u306e\u57fa\u672c\u4f8b\nDim weekdays As Variant\nweekdays = Array(&quot;\u6708\u66dc\u65e5&quot;, &quot;\u706b\u66dc\u65e5&quot;, &quot;\u6c34\u66dc\u65e5&quot;, &quot;\u6728\u66dc\u65e5&quot;, &quot;\u91d1\u66dc\u65e5&quot;, &quot;\u571f\u66dc\u65e5&quot;, &quot;\u65e5\u66dc\u65e5&quot;)\n\n&#x27; \u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f0\u59cb\u307e\u308a\nDebug.Print weekdays(0)  &#x27; \u2192 \u6708\u66dc\u65e5\nDebug.Print weekdays(6)  &#x27; \u2192 \u65e5\u66dc\u65e5\n\n&#x27; \u6708\u540d\u30ea\u30b9\u30c8\u306e\u4f8b\nDim monthNames As Variant\nmonthNames = Array(&quot;1\u6708&quot;, &quot;2\u6708&quot;, &quot;3\u6708&quot;, &quot;4\u6708&quot;, &quot;5\u6708&quot;, &quot;6\u6708&quot;, _\n                   &quot;7\u6708&quot;, &quot;8\u6708&quot;, &quot;9\u6708&quot;, &quot;10\u6708&quot;, &quot;11\u6708&quot;, &quot;12\u6708&quot;)\nDebug.Print monthNames(0)   &#x27; \u2192 1\u6708\uff080\u59cb\u307e\u308a\uff09\nDebug.Print monthNames(11)  &#x27; \u2192 12\u6708\n\n&#x27; \u6570\u5024\u306e\u914d\u5217\nDim taxRates As Variant\ntaxRates = Array(0.08, 0.10, 0.10)  &#x27; 2014\u5e74\u30fb2019\u5e74\u30fb\u73fe\u5728\u306e\u6d88\u8cbb\u7a0e\u7387<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>Array\u95a2\u6570<\/strong>\uff1aVBA\u7d44\u307f\u8fbc\u307f\u306e\u95a2\u6570\u3002\u62ec\u5f27\u5185\u306b\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u5024\u3092\u5217\u6319\u3059\u308b\u3068\u3001\u305d\u308c\u3089\u3092\u683c\u7d0d\u3057\u305fVariant\u578b\u306e\u914d\u5217\u3092\u8fd4\u3057\u307e\u3059\u3002\u623b\u308a\u5024\u306fVariant\u578b\u306e\u5909\u6570\u3067\u306e\u307f\u53d7\u3051\u53d6\u308c\u307e\u3059\u3002\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u30670\u59cb\u307e\u308a\u3067\u3059\u304c\u3001Option Base 1\u3092\u6307\u5b9a\u3059\u308b\u30681\u59cb\u307e\u308a\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4-2. \u5fc5\u9808\u30eb\u30fc\u30eb\uff1a\u53d7\u3051\u53d6\u308b\u5909\u6570\u306fVariant\u578b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Array\u95a2\u6570\u3092\u4f7f\u3046\u969b\u306e\u91cd\u8981\u306a\u30eb\u30fc\u30eb\u304c1\u3064\u3042\u308a\u307e\u3059\u3002\u623b\u308a\u5024\u3092\u53d7\u3051\u53d6\u308b\u5909\u6570\u306f\u5fc5\u305a<strong>Variant\u578b<\/strong>\u3067\u5ba3\u8a00\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002Integer\u3084String\u7b49\u306e\u5177\u4f53\u7684\u306a\u578b\u3067\u5ba3\u8a00\u3057\u305f\u5909\u6570\u306bArray\u95a2\u6570\u306e\u7d50\u679c\u3092\u4ee3\u5165\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u300c\u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\uff08\u30a8\u30e9\u30fc\u756a\u53f713\uff09\u300d\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u3053\u306e\u30a8\u30e9\u30fc\u306fArray\u95a2\u6570\u3092\u521d\u3081\u3066\u4f7f\u3046\u65b9\u304c\u307b\u307c\u78ba\u5b9f\u306b\u4e00\u5ea6\u306f\u8e0f\u3080\u306e\u3067\u3001\u300cArray\u95a2\u6570\u3092\u4f7f\u3046\u3068\u304d\u306fVariant\u578b\u300d\u3068\u899a\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; NG\u4f8b\uff1aString\u578b\u3067\u53d7\u3051\u53d6\u308d\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\n&#x27; Dim wrongVar() As String\n&#x27; wrongVar = Array(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)  &#x27; \u30a8\u30e9\u30fc13: \u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\n\n&#x27; OK\u4f8b\uff1aVariant\u578b\u3067\u53d7\u3051\u53d6\u308b\nDim correctVar As Variant\ncorrectVar = Array(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)  &#x27; \u6b63\u5e38\u52d5\u4f5c\n\n&#x27; UBound\u30fbLBound\u3067\u8981\u7d20\u6570\u3092\u78ba\u8a8d\u3067\u304d\u308b\nDebug.Print LBound(correctVar)  &#x27; \u2192 0\nDebug.Print UBound(correctVar)  &#x27; \u2192 2\uff083\u8981\u7d20\u306a\u306e\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b90\u301c2\uff09\n\n&#x27; For\u30eb\u30fc\u30d7\u3067\u5168\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\nDim i As Integer\nFor i = LBound(correctVar) To UBound(correctVar)\n    Debug.Print correctVar(i)  &#x27; A, B, C \u306e\u9806\u306b\u51fa\u529b\nNext i<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4-3. \u696d\u52d9\u3067\u306e\u5b9f\u8df5\u6d3b\u7528\uff1a\u30de\u30b9\u30bf\u30fc\u30c7\u30fc\u30bf\u5b9a\u7fa9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Array\u95a2\u6570\u304c\u7279\u306b\u5a01\u529b\u3092\u767a\u63ee\u3059\u308b\u306e\u306f\u3001\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u3067\u5171\u901a\u3057\u3066\u4f7f\u3046\u300c\u30de\u30b9\u30bf\u30fc\u30c7\u30fc\u30bf\u306e\u5b9a\u7fa9\u300d\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u696d\u52d9\u30b9\u30c6\u30fc\u30bf\u30b9\u306e\u30b3\u30fc\u30c9\u30ea\u30b9\u30c8\u3001\u90e8\u7f72\u540d\u3001\u5546\u54c1\u30ab\u30c6\u30b4\u30ea\u306a\u3069\u3092\u914d\u5217\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u304a\u304f\u3068\u3001\u30de\u30af\u30ed\u5168\u4f53\u3067\u305d\u306e\u914d\u5217\u3092\u53c2\u7167\u3059\u308b\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002\u5024\u306e\u5909\u66f4\u304c\u5fc5\u8981\u306a\u3068\u304d\u3082Array\u95a2\u6570\u306e1\u884c\u3092\u4fee\u6b63\u3059\u308b\u3060\u3051\u3067\u5168\u51e6\u7406\u306b\u53cd\u6620\u3055\u308c\u308b\u305f\u3081\u3001\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u304c\u5927\u5e45\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u696d\u52d9\u3067\u306e\u6d3b\u7528\u4f8b\uff1a\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306e\u30de\u30b9\u30bf\u30fc\u914d\u5217\nSub ProcessOrders()\n    &#x27; \u53d7\u6ce8\u30b9\u30c6\u30fc\u30bf\u30b9\u306e\u30de\u30b9\u30bf\u30fc\u914d\u5217\uff08Array\u95a2\u6570\u3067\u4e00\u62ec\u5b9a\u7fa9\uff09\n    Dim statusCodes As Variant\n    statusCodes = Array(&quot;\u672a\u51e6\u7406&quot;, &quot;\u51e6\u7406\u4e2d&quot;, &quot;\u51fa\u8377\u6e08&quot;, &quot;\u5b8c\u4e86&quot;, &quot;\u30ad\u30e3\u30f3\u30bb\u30eb&quot;)\n\n    &#x27; \u30ab\u30c6\u30b4\u30ea\u30de\u30b9\u30bf\u30fc\n    Dim categories As Variant\n    categories = Array(&quot;\u96fb\u5b50\u90e8\u54c1&quot;, &quot;\u6a5f\u68b0\u90e8\u54c1&quot;, &quot;\u6d88\u8017\u54c1&quot;, &quot;\u5099\u54c1&quot;, &quot;\u30b5\u30fc\u30d3\u30b9&quot;)\n\n    &#x27; \u30b7\u30fc\u30c8\u306e\u30c7\u30fc\u30bf\u30921\u4ef6\u305a\u3064\u78ba\u8a8d\u3057\u3066\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u691c\u8a3c\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u53d7\u6ce8\u30c7\u30fc\u30bf&quot;)\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim status As String\n        status = ws.Cells(r, 3).Value  &#x27; C\u5217\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\n\n        &#x27; \u30de\u30b9\u30bf\u30fc\u914d\u5217\u306b\u4e00\u81f4\u3059\u308b\u304b\u78ba\u8a8d\n        Dim isValid As Boolean\n        isValid = False\n        Dim s As Integer\n        For s = LBound(statusCodes) To UBound(statusCodes)\n            If status = statusCodes(s) Then\n                isValid = True\n                Exit For\n            End If\n        Next s\n\n        If Not isValid Then\n            ws.Cells(r, 3).Interior.Color = RGB(255, 200, 200)  &#x27; \u7121\u52b9\u5024\u3092\u8d64\u304f\u30cf\u30a4\u30e9\u30a4\u30c8\n        End If\n    Next r\n\n    MsgBox &quot;\u30b9\u30c6\u30fc\u30bf\u30b9\u691c\u8a3c\u5b8c\u4e86&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">Array\u95a2\u6570\u3068Select Case\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u914d\u5217\u3092Loop\u5185\u3067\u306e\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u4f7f\u3046\u3060\u3051\u3067\u306a\u304f\u3001Join\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u300c1\u6708,2\u6708,...,12\u6708\u300d\u306e\u3088\u3046\u306a\u30ab\u30f3\u30de\u533a\u5207\u308a\u6587\u5b57\u5217\u306b\u5909\u63db\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u300cFilter(\u914d\u5217, \u691c\u7d22\u6587\u5b57)\u300d\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001\u914d\u5217\u304b\u3089\u6761\u4ef6\u306b\u5408\u3046\u8981\u7d20\u3060\u3051\u3092\u62bd\u51fa\u3057\u305f\u65b0\u3057\u3044\u914d\u5217\u3092\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u696d\u52d9\u30de\u30af\u30ed\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Array\u95a2\u6570\u306f\u300c\u8a2d\u5b9a\u5024\u306e\u8f9e\u66f8\u300d\u3068\u3057\u3066\u4f7f\u3046\u306e\u304c\u6700\u3082\u30b9\u30de\u30fc\u30c8\u3067\u3059\u3002\u5f0a\u793e\u306e\u5728\u5eab\u7ba1\u7406\u30de\u30af\u30ed\u3067\u306f\u3001\u5546\u54c1\u30ab\u30c6\u30b4\u30ea\u30b3\u30fc\u30c9\u306e\u30ea\u30b9\u30c8\u3092Array\u95a2\u6570\u3067\u5b9a\u7fa9\u3057\u3001\u30eb\u30fc\u30d7\u3067\u7167\u5408\u3057\u3066\u3044\u307e\u3059\u3002\u30ab\u30c6\u30b4\u30ea\u304c\u8ffd\u52a0\u30fb\u5909\u66f4\u3055\u308c\u305f\u969b\u30821\u884c\u4fee\u6b63\u3059\u308b\u3060\u3051\u3067\u5168\u30de\u30af\u30ed\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-05\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">05<\/span>\n  <span class=\"section-label\" style=\"display:block;\">REDIM<\/span>\n  <span class=\"section-title\" style=\"display:block;\">ReDim\u3067\u8981\u7d20\u6570\u3092\u5909\u66f4\u3059\u308b<\/span>\n  <span class=\"section-desc\">\u53ef\u5909\u9577\u914d\u5217\u306e\u8981\u7d20\u6570\u3092\u5b9f\u884c\u6642\u306b\u8a2d\u5b9a\u30fb\u5909\u66f4\u3059\u308b\u547d\u4ee4\u306e\u4f7f\u3044\u65b9<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ReDim\uff08Re-Dimension\u306e\u7565\uff09\u306f\u3001\u53ef\u5909\u9577\u914d\u5217\u306e\u8981\u7d20\u6570\u3092\u5b9f\u884c\u6642\u306b\u8a2d\u5b9a\u30fb\u5909\u66f4\u3059\u308b\u305f\u3081\u306e\u547d\u4ee4\u3067\u3059\u3002\u300cDim arr() As String\u300d\u3067\u5ba3\u8a00\u3057\u305f\u53ef\u5909\u9577\u914d\u5217\u306f\u3001\u5ba3\u8a00\u76f4\u5f8c\u306f\u30b5\u30a4\u30ba0\u306e\u7a7a\u306e\u914d\u5217\u3067\u3059\u3002\u5b9f\u969b\u306b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3067\u304d\u308b\u72b6\u614b\u306b\u3059\u308b\u306b\u306f\u3001ReDim\u3067\u8981\u7d20\u6570\u3092\u78ba\u4fdd\u3057\u3066\u304b\u3089\u3067\u306a\u3044\u3068\u300c\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u53d6\u5f97\u3057\u305f\u30ec\u30b3\u30fc\u30c9\u6570\u3001Excel\u30b7\u30fc\u30c8\u306e\u884c\u6570\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u5165\u529b\u3057\u305f\u4ef6\u6570\u306a\u3069\u3001\u5b9f\u884c\u6642\u306b\u521d\u3081\u3066\u5224\u660e\u3059\u308b\u4ef6\u6570\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u306e\u5fc5\u9808\u547d\u4ee4\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5-1. ReDim\u306e\u57fa\u672c\u69cb\u6587<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; ReDim\u306e\u57fa\u672c\u4f7f\u7528\u4f8b\nDim customerData() As String  &#x27; \u53ef\u5909\u9577\u914d\u5217\u3092\u5ba3\u8a00\n\n&#x27; \u5b9f\u884c\u6642\u306b\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u78ba\u5b9a\u3059\u308b\nDim ws As Worksheet\nSet ws = ThisWorkbook.Sheets(&quot;\u9867\u5ba2\u30ea\u30b9\u30c8&quot;)\nDim rowCount As Long\nrowCount = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row - 1  &#x27; \u30d8\u30c3\u30c0\u30fc\u3092\u9664\u3044\u305f\u4ef6\u6570\n\n&#x27; \u78ba\u5b9a\u3057\u305f\u4ef6\u6570\u3067ReDim\nReDim customerData(rowCount - 1)  &#x27; 0\u301crowCount-1\u306erowCount\u4ef6\u3092\u78ba\u4fdd\n\n&#x27; \u30c7\u30fc\u30bf\u3092\u683c\u7d0d\nDim i As Long\nFor i = 0 To rowCount - 1\n    customerData(i) = ws.Cells(i + 2, 1).Value  &#x27; 2\u884c\u76ee\u304b\u3089\u30c7\u30fc\u30bf\u8aad\u307f\u8fbc\u307f\nNext i\n\nDebug.Print &quot;\u53d6\u5f97\u4ef6\u6570: &quot; &amp; (UBound(customerData) + 1) &amp; &quot;\u4ef6&quot;\n\n&#x27; 2\u6b21\u5143\u914d\u5217\u306eReDim\nDim salesMatrix() As Double\nReDim salesMatrix(rowCount - 1, 3)  &#x27; \u884c\u6570\u00d74\u5217\u306e2\u6b21\u5143\u914d\u5217<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>ReDim<\/strong>\uff1a\u53ef\u5909\u9577\u914d\u5217\uff08\u8981\u7d20\u6570\u306a\u3057\u3067\u5ba3\u8a00\u3057\u305f\u914d\u5217\uff09\u306e\u8981\u7d20\u6570\u3092\u5b9f\u884c\u6642\u306b\u8a2d\u5b9a\u30fb\u5909\u66f4\u3059\u308b\u305f\u3081\u306eVBA\u547d\u4ee4\u3002ReDim\u3092\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u914d\u5217\u306e\u5168\u8981\u7d20\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\uff08\u6570\u5024\u306f0\u3001\u6587\u5b57\u5217\u306f\u7a7a\u6587\u5b57\uff09\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3057\u305f\u3044\u5834\u5408\u306fReDim Preserve\u3092\u4f7f\u3044\u307e\u3059\u3002\u56fa\u5b9a\u9577\u914d\u5217\uff08Dim arr(9) As\u578b\uff09\u306bReDim\u3092\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5-2. \u91cd\u8981\uff1aReDim\u3092\u5b9f\u884c\u3059\u308b\u3068\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u308b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">ReDim\u3092\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u3001\u305d\u306e\u914d\u5217\u306e\u5168\u8981\u7d20\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002\u3053\u308c\u306f\u56fa\u5b9a\u9577\u914d\u5217\u306eErase\u3068\u540c\u69d8\u306e\u6319\u52d5\u3067\u3059\u3002\u300c\u30c7\u30fc\u30bf\u3092\u9014\u4e2d\u307e\u3067\u683c\u7d0d\u3057\u3066\u304a\u3044\u3066\u3001\u9014\u4e2d\u3067ReDim\u3057\u3066\u8981\u7d20\u6570\u3092\u5909\u3048\u305f\u3044\u300d\u3068\u3044\u3046\u5834\u5408\u306f\u3001\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u89e3\u8aac\u3059\u308b\u300cReDim Preserve\u300d\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u30c7\u30fc\u30bf\u30ea\u30bb\u30c3\u30c8\u306e\u6319\u52d5\u3092\u77e5\u3089\u305a\u306bReDim\u3092\u4f7f\u3046\u3068\u3001\u305b\u3063\u304b\u304f\u84c4\u7a4d\u3057\u305f\u30c7\u30fc\u30bf\u304c\u5168\u3066\u6d88\u3048\u308b\u30d0\u30b0\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; ReDim\u3067\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u308b\u4f8b\nDim arr() As Integer\nReDim arr(4)  &#x27; 5\u8981\u7d20\u3092\u78ba\u4fdd\narr(0) = 10: arr(1) = 20: arr(2) = 30\n\nDebug.Print arr(0)  &#x27; \u2192 10\n\nReDim arr(9)  &#x27; \u518d\u5ea6ReDim\uff08\u8981\u7d20\u6570\u3092\u5909\u66f4\uff09\n\nDebug.Print arr(0)  &#x27; \u2192 0\uff08\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u305f\uff01\uff09\n\n&#x27; \u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3057\u305f\u3044\u5834\u5408\u306fReDim Preserve\u3092\u4f7f\u3046\nReDim arr(4)\narr(0) = 10: arr(1) = 20: arr(2) = 30\n\nReDim Preserve arr(9)  &#x27; Preserve\u30ad\u30fc\u30ef\u30fc\u30c9\u4ed8\u304d\nDebug.Print arr(0)  &#x27; \u2192 10\uff08\u30c7\u30fc\u30bf\u304c\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\uff09<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5-3. \u591a\u6b21\u5143\u914d\u5217\u306eReDim<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6b21\u5143\u914d\u5217\u3092ReDim\u3067\u5ba3\u8a00\u3059\u308b\u969b\u306f\u3001\u5168\u3066\u306e\u6b21\u5143\u6570\u3092\u540c\u6642\u306b\u6307\u5b9a\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u58f2\u4e0a\u30c7\u30fc\u30bf\u3092\u300c\u884c\uff08\u9867\u5ba2\u6570\uff09\u00d7\u5217\uff08\u6708\u6570\uff09\u300d\u3067\u7ba1\u7406\u3059\u308b\u5834\u5408\u3001ReDim salesData(customerCount-1, 11)\u306e\u3088\u3046\u306b2\u6b21\u5143\u914d\u5217\u3068\u3057\u3066\u78ba\u4fdd\u3057\u307e\u3059\u3002\u91cd\u8981\u306a\u5236\u9650\u3068\u3057\u3066\u3001ReDim Preserve\uff08\u30c7\u30fc\u30bf\u4fdd\u6301\uff09\u3067\u591a\u6b21\u5143\u914d\u5217\u3092\u62e1\u5f35\u3067\u304d\u308b\u306e\u306f\u6700\u5f8c\u306e\u6b21\u5143\u306e\u307f\u3067\u3059\uff08\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u8a73\u8ff0\uff09\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u591a\u6b21\u5143\u914d\u5217\u306eReDim\u4f8b\nDim matrix() As Double\n\n&#x27; \u9867\u5ba2\u6570\u304c\u78ba\u5b9a\u3057\u3066\u304b\u30892\u6b21\u5143\u914d\u5217\u3092\u78ba\u4fdd\nDim customerCount As Long\ncustomerCount = 100  &#x27; 100\u9867\u5ba2\n\n&#x27; 100\u884c\u00d712\u5217\uff08\u6708\u5225\u58f2\u4e0a\uff09\u306e2\u6b21\u5143\u914d\u5217\nReDim matrix(customerCount - 1, 11)\n\n&#x27; \u30c7\u30fc\u30bf\u3092\u683c\u7d0d\nmatrix(0, 0) = 1200000   &#x27; \u9867\u5ba20\u756a\u306e1\u6708\u58f2\u4e0a\nmatrix(0, 1) = 980000    &#x27; \u9867\u5ba20\u756a\u306e2\u6708\u58f2\u4e0a\nmatrix(99, 11) = 2100000 &#x27; \u9867\u5ba299\u756a\u306e12\u6708\u58f2\u4e0a\n\nDebug.Print &quot;\u884c\u6570: &quot; &amp; (UBound(matrix, 1) + 1)  &#x27; \u2192 100\nDebug.Print &quot;\u5217\u6570: &quot; &amp; (UBound(matrix, 2) + 1)  &#x27; \u2192 12<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>ReDim\u306f\u53ef\u5909\u9577\u914d\u5217\uff08Dim arr() As\u578b\uff09\u306b\u306e\u307f\u4f7f\u7528\u53ef\u80fd<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>ReDim\u3092\u5b9f\u884c\u3059\u308b\u3068\u5168\u8981\u7d20\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u56fa\u5b9a\u9577\u914d\u5217\uff08Dim arr(9) As\u578b\uff09\u306bReDim\u3092\u4f7f\u3046\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u591a\u6b21\u5143\u914d\u5217\u306fReDim\u6642\u306b\u5168\u6b21\u5143\u3092\u540c\u6642\u306b\u6307\u5b9a\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3059\u308b\u306b\u306fReDim Preserve\u3092\u4f7f\u3046\uff08\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u53c2\u7167\uff09<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">ReDim\u3092\u8907\u6570\u56de\u547c\u3076\u30b3\u30fc\u30c9\u306f\u3001\u6bce\u56de\u5168\u30c7\u30fc\u30bf\u30ea\u30bb\u30c3\u30c8\u304c\u8d70\u308b\u305f\u3081\u614e\u91cd\u306b\u8a2d\u8a08\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ef6\u6570\u304c\u5b8c\u5168\u306b\u78ba\u5b9a\u3057\u3066\u304b\u3089ReDim\u4e00\u56de\u3067\u78ba\u4fdd\u3059\u308b\u306e\u304c\u7406\u60f3\u3067\u3059\u3002\u300c\u3068\u308a\u3042\u3048\u305a\u5927\u304d\u3081\u306bReDim\u3057\u3066\u5f8c\u3067Preserve\u3067\u7e2e\u5c0f\u300d\u3068\u3044\u3046\u624b\u3082\u3042\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-06\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">06<\/span>\n  <span class=\"section-label\" style=\"display:block;\">REDIM PRESERVE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">ReDim Preserve\u3067\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u62e1\u5f35\u3059\u308b<\/span>\n  <span class=\"section-desc\">Preserve\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u4f7f\u3044\u65b9\u3068\u591a\u6b21\u5143\u914d\u5217\u306e\u5236\u7d04<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ReDim Preserve\u306f\u3001\u914d\u5217\u306e\u73fe\u5728\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u8981\u7d20\u6570\u3092\u5909\u66f4\u3067\u304d\u308b\u547d\u4ee4\u3067\u3059\u3002\u300cReDim\u300d\u5358\u4f53\u3060\u3068\u65e2\u5b58\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u304c\u3001\u300cPreserve\u300d\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u65e2\u5b58\u30c7\u30fc\u30bf\u3092\u6b8b\u3057\u306a\u304c\u3089\u30b5\u30a4\u30ba\u5909\u66f4\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u300c\u30c7\u30fc\u30bf\u30921\u4ef6\u305a\u3064\u52d5\u7684\u306b\u8ffd\u52a0\u3057\u306a\u304c\u3089\u3001\u914d\u5217\u3092\u90fd\u5ea6\u62e1\u5f35\u3057\u3066\u3044\u304f\u300d\u3068\u3044\u3046\u51e6\u7406\u3067\u5fc5\u9808\u306e\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6-1. ReDim Preserve\u306e\u57fa\u672c\u69cb\u6587<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; ReDim Preserve\u306e\u57fa\u672c\u4f8b\nDim results() As String\nDim count As Long\ncount = 0\n\n&#x27; \u30c7\u30fc\u30bf\u30921\u4ef6\u305a\u3064\u8ffd\u52a0\u3057\u3066\u3044\u304f\u51e6\u7406\uff08\u4ef6\u6570\u304c\u5b9f\u884c\u6642\u306b\u5897\u3048\u308b\u4f8b\uff09\nDim ws As Worksheet\nSet ws = ThisWorkbook.Sheets(&quot;\u30c7\u30fc\u30bf&quot;)\nDim lastRow As Long\nlastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\nDim r As Long\nFor r = 2 To lastRow\n    &#x27; \u6761\u4ef6\u306b\u5408\u3046\u30c7\u30fc\u30bf\u3060\u3051\u914d\u5217\u306b\u8ffd\u52a0\uff08\u4f8b\uff1a\u58f2\u4e0a100\u4e07\u5186\u4ee5\u4e0a\uff09\n    If ws.Cells(r, 2).Value &gt;= 1000000 Then\n        ReDim Preserve results(count)  &#x27; 1\u4ef6\u5206\u62e1\u5f35\uff08\u30c7\u30fc\u30bf\u4fdd\u6301\uff09\n        results(count) = ws.Cells(r, 1).Value\n        count = count + 1\n    End If\nNext r\n\nDebug.Print &quot;\u5408\u683c\u4ef6\u6570: &quot; &amp; count &amp; &quot;\u4ef6&quot;\nIf count &gt; 0 Then\n    Debug.Print &quot;\u6700\u521d\u306e\u5408\u683c\u9867\u5ba2: &quot; &amp; results(0)\nEnd If<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6-2. \u91cd\u8981\u306a\u5236\u7d04\uff1a\u591a\u6b21\u5143\u914d\u5217\u306f\u6700\u5f8c\u306e\u6b21\u5143\u306e\u307f\u5909\u66f4\u53ef\u80fd<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">ReDim Preserve\u306b\u306f\u91cd\u8981\u306a\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u3002<strong>\u591a\u6b21\u5143\u914d\u5217\u306e\u5834\u5408\u3001\u5909\u66f4\u3067\u304d\u308b\u306e\u306f\u6700\u5f8c\u306e\u6b21\u5143\uff08\u4e00\u756a\u53f3\uff09\u306e\u307f<\/strong>\u3067\u3059\u30022\u6b21\u5143\u914d\u5217arr(\u884c, \u5217)\u3067\u3042\u308c\u3070\u3001Preserve\u3067\u5909\u66f4\u3067\u304d\u308b\u306e\u306f\u5217\u65b9\u5411\uff082\u6b21\u5143\u76ee\uff09\u3060\u3051\u3067\u3001\u884c\u65b9\u5411\uff081\u6b21\u5143\u76ee\uff09\u306f\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002\u3082\u3057\u884c\u65b9\u5411\u306b\u52d5\u7684\u306b\u62e1\u5f35\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u6700\u521d\u304b\u3089\u884c\u3068\u5217\u306e\u5b9a\u7fa9\u3092\u8ee2\u7f6e\uff08\u9006\u306b\u3059\u308b\uff09\u3057\u3066\u8a2d\u8a08\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; 2\u6b21\u5143\u914d\u5217\u306eReDim Preserve\u5236\u7d04\nDim arr() As Integer\nReDim arr(2, 9)  &#x27; 3\u884c\u00d710\u5217\n\narr(0, 0) = 100  &#x27; \u30c7\u30fc\u30bf\u3092\u683c\u7d0d\n\n&#x27; NG\u4f8b\uff1a1\u6b21\u5143\u76ee\uff08\u884c\uff09\u3092\u62e1\u5f35\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\n&#x27; ReDim Preserve arr(4, 9)  &#x27; \u30a8\u30e9\u30fc\uff01 1\u6b21\u5143\u76ee\u306f\u5909\u66f4\u3067\u304d\u306a\u3044\n\n&#x27; OK\u4f8b\uff1a2\u6b21\u5143\u76ee\uff08\u5217\uff09\u3092\u62e1\u5f35\u3059\u308b\u306e\u306fOK\nReDim Preserve arr(2, 14)  &#x27; 3\u884c\u00d715\u5217\u306b\u62e1\u5f35\uff08\u30c7\u30fc\u30bf\u4fdd\u6301\uff09\nDebug.Print arr(0, 0)  &#x27; \u2192 100\uff08\u4fdd\u6301\u3055\u308c\u3066\u3044\u308b\uff09\n\n&#x27; \u884c\u65b9\u5411\u306b\u52d5\u7684\u62e1\u5f35\u3057\u305f\u3044\u5834\u5408\u306f\u8ee2\u7f6e\u3057\u3066\u8a2d\u8a08\u3059\u308b\n&#x27; arr(\u5217, \u884c) \u3068\u3057\u3066\u3001\u884c\u65b9\u5411\u306e\u62e1\u5f35\u30922\u6b21\u5143\u76ee\u3067\u8868\u73fe\u3059\u308b<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">ReDim Preserve\u306e\u7f60\uff1a\u6700\u5f8c\u306e\u6b21\u5143\u3057\u304b\u5909\u66f4\u3067\u304d\u306a\u3044<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">2\u6b21\u5143\u914d\u5217arr(\u884c, \u5217)\u306b\u5bfe\u3057\u3066\u300cReDim Preserve arr(\u65b0\u3057\u3044\u884c\u6570, \u5217\u6570)\u300d\u3068\u66f8\u304f\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002Preserve\u3067\u5909\u66f4\u3067\u304d\u308b\u306e\u306f\u6700\u5f8c\u306e\u6b21\u5143\uff08\u5217\u65b9\u5411\uff09\u306e\u307f\u3067\u3059\u3002\u884c\u65b9\u5411\u306b\u52d5\u7684\u306b\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u914d\u5217\u306e\u5b9a\u7fa9\u3092\u8ee2\u7f6e\u3057\u3066\u300carr(\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9, \u884c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9)\u300d\u306e\u5f62\u306b\u3059\u308b\u304b\u3001\u5148\u306b\u884c\u6570\u306e\u4e0a\u9650\u3092\u5927\u304d\u3081\u306bReDim\u3057\u3066\u304a\u3044\u3066\u6700\u5f8c\u306bPreserve\u3067\u7e2e\u5c0f\u3059\u308b\u8a2d\u8a08\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>ReDim<\/strong><br><span style=\"font-size:12px;\">\u5168\u30c7\u30fc\u30bf\u30ea\u30bb\u30c3\u30c8<br>\u8981\u7d20\u6570\u5909\u66f4<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>ReDim<br>Preserve<\/strong><br><span style=\"font-size:12px;\">\u30c7\u30fc\u30bf\u4fdd\u6301<br>\u8981\u7d20\u6570\u5909\u66f4<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u591a\u6b21\u5143\u5236\u7d04<\/strong><br><span style=\"font-size:12px;\">\u6700\u5f8c\u306e\u6b21\u5143<br>\u306e\u307f\u5909\u66f4\u53ef<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/strong><br><span style=\"font-size:12px;\">\u30eb\u30fc\u30d7\u5185\u306f<br>\u907f\u3051\u308b<\/span><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6-3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4e0a\u306e\u6ce8\u610f\u70b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">ReDim Preserve\u306f\u30eb\u30fc\u30d7\u5185\u30671\u4ef6\u305a\u3064\u5b9f\u884c\u3059\u308b\u306e\u306f\u907f\u3051\u3066\u304f\u3060\u3055\u3044\u3002ReDim Preserve\u306e\u305f\u3073\u306b\u30e1\u30e2\u30ea\u306e\u518d\u5272\u308a\u5f53\u3066\uff08\u65e2\u5b58\u30c7\u30fc\u30bf\u306e\u30b3\u30d4\u30fc\uff09\u304c\u8d70\u308b\u305f\u3081\u3001\u4ef6\u6570\u304c\u591a\u3044\uff081000\u4ef6\u4ee5\u4e0a\uff09\u5834\u5408\u306b\u51e6\u7406\u901f\u5ea6\u304c\u8457\u3057\u304f\u4f4e\u4e0b\u3057\u307e\u3059\u300210000\u4ef6\u306e\u30c7\u30fc\u30bf\u30671\u4ef6\u305a\u3064Preserve\u3092\u7e70\u308a\u8fd4\u3059\u3068\u3001\u4f53\u611f\u3067\u304d\u308b\u307b\u3069\u9045\u304f\u306a\u308a\u307e\u3059\u3002\u63a8\u5968\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u300c\u914d\u5217\u3092\u5927\u304d\u3081\u306b\u521d\u671f\u78ba\u4fdd\u2192\u51e6\u7406\u5f8c\u306b\u5b9f\u4ef6\u6570\u3067Preserve\u3067\u7e2e\u5c0f\u300d\u306e1\u56de\u547c\u3073\u51fa\u3057\u65b9\u5f0f\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u9ad8\u901f\u30d1\u30bf\u30fc\u30f3\uff1aPreserve\u30921\u56de\u3060\u3051\u547c\u3076\nDim results() As String\nDim maxRows As Long\nmaxRows = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n&#x27; \u4e0a\u9650\u3092\u6700\u5927\u4ef6\u6570\u3067\u5148\u306b\u78ba\u4fdd\uff08Preserve\u306a\u3057\uff09\nReDim results(maxRows - 1)\n\nDim actualCount As Long\nactualCount = 0\nDim r As Long\nFor r = 2 To maxRows\n    If ws.Cells(r, 2).Value &gt;= 1000000 Then\n        results(actualCount) = ws.Cells(r, 1).Value\n        actualCount = actualCount + 1\n    End If\nNext r\n\n&#x27; \u6700\u5f8c\u306b\u5b9f\u4ef6\u6570\u3067Preserve\u30921\u56de\u3060\u3051\u5b9f\u884c\uff08\u4f59\u5206\u306a\u9818\u57df\u3092\u5207\u308a\u843d\u3068\u3059\uff09\nIf actualCount &gt; 0 Then\n    ReDim Preserve results(actualCount - 1)\nEnd If\nDebug.Print &quot;\u5408\u683c\u4ef6\u6570: &quot; &amp; actualCount<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Preserve\u3092\u30eb\u30fc\u30d7\u5185\u3067\u4f7f\u3046\u306e\u306f\u300c\u6bce\u56de\u4f1a\u793e\u5f15\u8d8a\u3057\u3059\u308b\u3088\u3046\u306a\u3082\u306e\u300d\u3067\u3059\u3002\u8377\u7269\u304c1\u4ef6\u5897\u3048\u308b\u305f\u3073\u306b\u30aa\u30d5\u30a3\u30b9\u5168\u4f53\u3092\u5f15\u3063\u8d8a\u3059\u3068\u81a8\u5927\u306a\u6642\u9593\u304c\u304b\u304b\u308b\u3002\u6700\u521d\u304b\u3089\u5927\u304d\u306a\u90e8\u5c4b\u3092\u501f\u308a\u3066\u3001\u6700\u5f8c\u306b\u5fc5\u8981\u306a\u5206\u3060\u3051\u7e2e\u5c0f\u3059\u308b\u65b9\u304c\u5727\u5012\u7684\u306b\u52b9\u7387\u7684\u3067\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-07\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">07<\/span>\n  <span class=\"section-label\" style=\"display:block;\">MULTIDIMENSIONAL<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u591a\u6b21\u5143\u914d\u5217\u306e\u521d\u671f\u5316\u3068\u696d\u52d9\u6d3b\u7528<\/span>\n  <span class=\"section-desc\">Excel\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u3068\u306e\u9023\u643a\u30fb\u9ad8\u901f\u5165\u51fa\u529b\u30d1\u30bf\u30fc\u30f3\u3092\u89e3\u8aac<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u696d\u52d9\u3067VBA\u914d\u5217\u3092\u4f7f\u3046\u3068\u304d\u3001\u6700\u3082\u983b\u7e41\u306b\u767b\u5834\u3059\u308b\u306e\u304c\u300c2\u6b21\u5143\u914d\u5217\u300d\u3067\u3059\u3002Excel\u306e\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u306f\u672c\u8cea\u7684\u306b\u300c\u884c\u00d7\u5217\u300d\u306e2\u6b21\u5143\u69cb\u9020\u306a\u306e\u3067\u3001\u30b7\u30fc\u30c8\u304b\u3089\u8aad\u307f\u8fbc\u3093\u3060\u30c7\u30fc\u30bf\u30922\u6b21\u5143\u914d\u5217\u3067\u7ba1\u7406\u3059\u308b\u3053\u3068\u3067\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u3082\u8868\u5f62\u5f0f\u306e\u307e\u307e\u6271\u3048\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u30012\u6b21\u5143\u914d\u5217\u306e\u521d\u671f\u5316\u304b\u3089\u3001Excel\u30b7\u30fc\u30c8\u3068\u306e\u9ad8\u901f\u30c7\u30fc\u30bf\u5165\u51fa\u529b\u307e\u3067\u5b9f\u8df5\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7-1. 2\u6b21\u5143\u914d\u5217\u306e\u5ba3\u8a00\u3068\u521d\u671f\u5316<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; 2\u6b21\u5143\u56fa\u5b9a\u9577\u914d\u5217\nDim salesData(99, 3) As Double   &#x27; 100\u884c\u00d74\u5217\uff08\u9867\u5ba2ID\u30011Q\u30012Q\u30013Q\uff09\n\n&#x27; 2\u6b21\u5143\u53ef\u5909\u9577\u914d\u5217\nDim dynamicData() As String\nDim rowCount As Long, colCount As Long\nrowCount = 200: colCount = 5\nReDim dynamicData(rowCount - 1, colCount - 1)\n\n&#x27; Erase\u30672\u6b21\u5143\u914d\u5217\u3092\u521d\u671f\u5316\n&#x27; \u56fa\u5b9a\u9577\u306a\u3089\u5168\u8981\u7d20\u30ea\u30bb\u30c3\u30c8\u3001\u53ef\u5909\u9577\u306a\u3089\u89e3\u653e\nErase salesData    &#x27; \u56fa\u5b9a\u9577\uff1a\u5168\u8981\u7d20\u304c0\u306b\u30ea\u30bb\u30c3\u30c8\uff08\u30b5\u30a4\u30ba\u7dad\u6301\uff09\nErase dynamicData  &#x27; \u53ef\u5909\u9577\uff1a\u89e3\u653e\uff08\u518d\u5229\u7528\u306b\u306fReDim\u304c\u5fc5\u8981\uff09<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>2\u6b21\u5143\u914d\u5217<\/strong>\uff1a2\u3064\u306e\u6dfb\u5b57\uff08\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u914d\u5217\u3002arr(\u884c\u756a\u53f7, \u5217\u756a\u53f7)\u306e\u5f62\u3067\u8981\u7d20\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002Excel\u306e\u30b7\u30fc\u30c8\uff08\u884c\u00d7\u5217\uff09\u3068\u540c\u3058\u69cb\u9020\u306a\u306e\u3067\u3001\u30bb\u30eb\u7bc4\u56f2\u30c7\u30fc\u30bf\u306e\u64cd\u4f5c\u306b\u6700\u9069\u3067\u3059\u3002VBA\u3067\u306f\u6700\u592760\u6b21\u5143\u307e\u3067\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u304c\u3001\u5b9f\u52d9\u3067\u306f2\u6b21\u5143\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-2. Excel\u30b7\u30fc\u30c8\u3068\u914d\u5217\u306e\u9ad8\u901f\u5165\u51fa\u529b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u3067\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u3068\u304d\u306e\u6700\u91cd\u8981\u30c6\u30af\u30cb\u30c3\u30af\u304c\u300c\u914d\u5217\u306e\u4e00\u62ec\u5165\u51fa\u529b\u300d\u3067\u3059\u3002\u901a\u5e38\u30011000\u884c\u306e\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u30671\u884c\u305a\u3064\u51e6\u7406\u3059\u308b\u30681000\u56de\u30bb\u30eb\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u304c\u3001<strong>Range.Value\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u3046\u30681\u56de\u306e\u64cd\u4f5c\u3067\u30b7\u30fc\u30c8\u5168\u4f53\u30922\u6b21\u5143\u914d\u5217\u306b\u8aad\u307f\u8fbc\u3081\u307e\u3059<\/strong>\u3002\u3053\u306e\u65b9\u6cd5\u30681\u4ef6\u305a\u3064\u30bb\u30eb\u3092\u8aad\u3080\u65b9\u6cd5\u3067\u306f\u3001\u51e6\u7406\u901f\u5ea6\u304c10\u301c100\u500d\u5909\u308f\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002Excel\u30de\u30af\u30ed\u306e\u9ad8\u901f\u5316\u3067\u6700\u521d\u306b\u899a\u3048\u308b\u3079\u304d\u6700\u91cd\u8981\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u9ad8\u901f\u30d1\u30bf\u30fc\u30f3\uff1a\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u4e00\u62ec\u914d\u5217\u306b\u8aad\u307f\u8fbc\u3080\nSub FastArrayProcess()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u58f2\u4e0a\u30c7\u30fc\u30bf&quot;)\n\n    &#x27; \u6700\u7d42\u884c\u3092\u53d6\u5f97\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    &#x27; Range.Value\u3067\u4e00\u62ec\u8aad\u307f\u8fbc\u307f\uff081\u56de\u306e\u30bb\u30eb\u30a2\u30af\u30bb\u30b9\u3067\u5168\u30c7\u30fc\u30bf\u53d6\u5f97\uff09\n    Dim data As Variant\n    data = ws.Range(&quot;A2:D&quot; &amp; lastRow).Value  &#x27; A2:D\u5217\u00d7lastRow\u884c\u3092\u4e00\u767a\u53d6\u5f97\n    &#x27; data\u306f(1\u301clastRow-1, 1\u301c4)\u306e2\u6b21\u5143Variant\u914d\u5217\uff081\u59cb\u307e\u308a\uff09\n\n    &#x27; \u914d\u5217\u4e0a\u3067\u51e6\u7406\uff08\u30bb\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306a\u3057\uff1d\u9ad8\u901f\uff09\n    Dim result() As Double\n    ReDim result(1 To lastRow - 1, 1 To 2)  &#x27; \u7d50\u679c\u683c\u7d0d\u7528\n\n    Dim r As Long\n    For r = 1 To lastRow - 1\n        result(r, 1) = data(r, 1)          &#x27; \u9867\u5ba2ID\n        result(r, 2) = data(r, 2) * 1.1    &#x27; \u58f2\u4e0a\u306b10%\u52a0\u7b97\n    Next r\n\n    &#x27; \u4e00\u62ec\u66f8\u304d\u8fbc\u307f\uff081\u56de\u306e\u30bb\u30eb\u30a2\u30af\u30bb\u30b9\u3067\u5168\u30c7\u30fc\u30bf\u66f8\u304d\u51fa\u3057\uff09\n    Dim wsOut As Worksheet\n    Set wsOut = ThisWorkbook.Sheets(&quot;\u7d50\u679c&quot;)\n    wsOut.Range(&quot;A2&quot;).Resize(lastRow - 1, 2).Value = result\n\n    MsgBox &quot;\u51e6\u7406\u5b8c\u4e86\uff08&quot; &amp; lastRow - 1 &amp; &quot;\u4ef6\uff09&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">Range.Value\u3067\u53d6\u5f97\u3057\u305f\u914d\u5217\u306f1\u59cb\u307e\u308a<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">ws.Range(\"A1:C10\").Value\u3067\u53d6\u5f97\u3057\u305f2\u6b21\u5143Variant\u914d\u5217\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306f\u30011\u59cb\u307e\u308a\uff08arr(1,1)\u301carr(10,3)\uff09\u306b\u306a\u308a\u307e\u3059\u3002\u901a\u5e38\u306e\u914d\u5217\u5ba3\u8a00\uff08Dim arr(9)\uff09\u306e0\u59cb\u307e\u308a\u3068\u306f\u7570\u306a\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002LBound(data, 1)\u3067\u3082LBound(data, 2)\u3067\u3082\u300c1\u300d\u304c\u8fd4\u308a\u307e\u3059\u3002\u3053\u306e\u4ed5\u69d8\u3092\u77e5\u3089\u305a\u306barr(0,0)\u3067\u30a2\u30af\u30bb\u30b9\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc9\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u306e\u6708\u6b21\u58f2\u4e0a\u96c6\u8a08\u30de\u30af\u30ed\u3092\u6539\u5584\u3057\u305f\u3068\u304d\u30011\u4ef6\u305a\u3064\u30bb\u30eb\u3092\u8aad\u3080\u30ed\u30b8\u30c3\u30af\u304b\u3089\u914d\u5217\u306e\u4e00\u62ec\u8aad\u307f\u8fbc\u307f\u306b\u5207\u308a\u66ff\u3048\u305f\u3060\u3051\u3067\u3001\u51e6\u7406\u6642\u9593\u304c18\u5206\u304b\u308925\u79d2\u306b\u77ed\u7e2e\u3055\u308c\u307e\u3057\u305f\u3002\u4ef6\u6570\u304c\u591a\u3044\u696d\u52d9\u30de\u30af\u30ed\u3067\u306f\u914d\u5217\u306e\u4e00\u62ec\u5165\u51fa\u529b\u306f\u5fc5\u9808\u3067\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u30b7\u30fc\u30c8\u5168\u4f53\u3092<br>\u4e00\u62ec\u8aad\u307f\u8fbc\u307f<\/strong><br><span style=\"font-size:12px;\">Range.Value\u2192<br>2\u6b21\u5143\u914d\u5217\u5316<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u914d\u5217\u4e0a\u3067<br>\u51e6\u7406\u5b9f\u884c<\/strong><br><span style=\"font-size:12px;\">\u30eb\u30fc\u30d7\u30fb\u30d5\u30a3\u30eb\u30bf<br>\u96c6\u8a08\u30fb\u5909\u63db<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u7d50\u679c\u914d\u5217\u306b<br>\u683c\u7d0d<\/strong><br><span style=\"font-size:12px;\">\u5225\u306e\u914d\u5217\u306b<br>\u7d50\u679c\u3092\u66f8\u304f<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u4e00\u62ec\u66f8\u304d\u8fbc\u307f<\/strong><br><span style=\"font-size:12px;\">\u914d\u5217\u2192Range.Value<br>\u30671\u56de\u66f8\u304d\u51fa\u3057<\/span><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u300c\u8aad\u307f\u8fbc\u307f\u2192\u914d\u5217\u51e6\u7406\u2192\u66f8\u304d\u51fa\u3057\u300d\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3046\u3068\u3001\u30bb\u30eb\u3078\u306e\u30a2\u30af\u30bb\u30b9\u56de\u6570\u304c\u300c\u5168\u4ef6\u6570\u00d72\uff08\u8aad\u307f\u66f8\u304d\uff09\u300d\u304b\u3089\u300c2\u56de\uff08\u4e00\u62ec\u8aad\u307f\u8fbc\u307f\u30fb\u4e00\u62ec\u66f8\u304d\u51fa\u3057\u54041\u56de\uff09\u300d\u306b\u6fc0\u6e1b\u3057\u307e\u3059\u30021000\u4ef6\u306a\u30892000\u56de\u21922\u56de\u300110000\u4ef6\u306a\u308920000\u56de\u21922\u56de\u3067\u3059\u3002Excel\u30de\u30af\u30ed\u304c\u9045\u304f\u3066\u56f0\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u539f\u56e0\u306e\u591a\u304f\u304c\u3053\u306e\u30bb\u30eb\u30a2\u30af\u30bb\u30b9\u904e\u591a\u306b\u3042\u308a\u3001\u914d\u5217\u3078\u306e\u5207\u308a\u66ff\u3048\u3067\u5287\u7684\u306b\u6539\u5584\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-08\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">08<\/span>\n  <span class=\"section-label\" style=\"display:block;\">ERROR HANDLING<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u5bfe\u51e6\u6cd5<\/span>\n  <span class=\"section-desc\">\u914d\u5217\u95a2\u9023\u306e\u30a8\u30e9\u30fc\u756a\u53f7\u3068\u6839\u672c\u539f\u56e0\u30fb\u4fee\u6b63\u65b9\u6cd5\u3092\u7db2\u7f85<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u914d\u5217\u51e6\u7406\u3067\u306f\u3001\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306e\u30a8\u30e9\u30fc\u304c\u7e70\u308a\u8fd4\u3057\u767a\u751f\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3060\u3051\u898b\u308b\u3068\u5206\u304b\u308a\u306b\u304f\u3044\u3067\u3059\u304c\u3001\u539f\u56e0\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u9650\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u4e00\u5ea6\u899a\u3048\u308c\u3070\u7d20\u65e9\u304f\u30c7\u30d0\u30c3\u30b0\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u914d\u5217\u95a2\u9023\u306e\u3088\u304f\u3042\u308b\u30a8\u30e9\u30fc\u3068\u305d\u306e\u5bfe\u51e6\u6cd5\u3092\u6574\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<table>\n<thead><tr><th>\u30a8\u30e9\u30fc\u756a\u53f7<\/th><th>\u30e1\u30c3\u30bb\u30fc\u30b8<\/th><th>\u4e3b\u306a\u539f\u56e0<\/th><th>\u5bfe\u51e6\u6cd5<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u30a8\u30e9\u30fc9<\/td><td>\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093<\/td><td>\u2460\u672aReDim\u306e\u53ef\u5909\u9577\u914d\u5217\u306b\u30a2\u30af\u30bb\u30b9 \u2461Erase\u3067\u89e3\u653e\u5f8c\u306b\u30a2\u30af\u30bb\u30b9 \u2462\u5ba3\u8a00\u3057\u305f\u4e0a\u9650\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8d85\u3048\u305f\u30a2\u30af\u30bb\u30b9<\/td><td>UBound()\u3067\u4e0a\u9650\u78ba\u8a8d\u3001ReDim\u524d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u306a\u3044\u304b\u78ba\u8a8d<\/td><\/tr>\n<tr><td>\u30a8\u30e9\u30fc13<\/td><td>\u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093<\/td><td>Array\u95a2\u6570\u306e\u623b\u308a\u5024\u3092Variant\u578b\u4ee5\u5916\u3067\u53d7\u3051\u53d6\u3063\u305f<\/td><td>\u53d7\u3051\u53d6\u308a\u5909\u6570\u3092Variant\u578b\u3067\u5ba3\u8a00\u3059\u308b<\/td><\/tr>\n<tr><td>\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc<\/td><td>\u914d\u5217\u306f\u3059\u3067\u306b\u6b21\u5143\u5316\u3055\u308c\u3066\u3044\u307e\u3059<\/td><td>\u56fa\u5b9a\u9577\u914d\u5217\u306bReDim\u3092\u4f7f\u3063\u305f<\/td><td>Dim arr() As\u578b\uff08\u8981\u7d20\u6570\u306a\u3057\uff09\u3067\u53ef\u5909\u9577\u3068\u3057\u3066\u5ba3\u8a00\u3057\u76f4\u3059<\/td><\/tr>\n<tr><td>\u30a8\u30e9\u30fc1004<\/td><td>\u6307\u5b9a\u3055\u308c\u305fRange\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093\uff08\u95a2\u9023\uff09<\/td><td>\u914d\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u8a08\u7b97\u30df\u30b9\u3067\u30b7\u30fc\u30c8\u7bc4\u56f2\u304c\u305a\u308c\u308b<\/td><td>UBound\/LBound\u3067\u5b9f\u969b\u306e\u8981\u7d20\u6570\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089Range\u6307\u5b9a<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\">8-1. \u30a8\u30e9\u30fc\u756a\u53f79\u300c\u6dfb\u3048\u5b57\u304c\u6709\u52b9\u7bc4\u56f2\u306b\u3042\u308a\u307e\u305b\u3093\u300d\u306e\u5bfe\u51e6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u3082\u983b\u7e41\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3067\u3059\u3002\u539f\u56e0\u306f\u4e3b\u306b3\u30d1\u30bf\u30fc\u30f3\u306b\u7d5e\u3089\u308c\u307e\u3059\u3002\u2460\u5ba3\u8a00\u3057\u305f\u3060\u3051\u3067ReDim\u3057\u3066\u3044\u306a\u3044\u53ef\u5909\u9577\u914d\u5217\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3001\u2461Erase\u3067\u89e3\u653e\u3055\u308c\u305f\u53ef\u5909\u9577\u914d\u5217\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3001\u2462\u30eb\u30fc\u30d7\u30ab\u30a6\u30f3\u30bf\u304cUBound()\u3092\u8d85\u3048\u305f\u2014\u2014\u3067\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u6642\u306f\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u884c\u306e\u914d\u5217\u540d\u3092\u78ba\u8a8d\u3057\u3001\u305d\u306e\u914d\u5217\u306e\u5ba3\u8a00\u30fbReDim\u30fbErase \u306e\u72b6\u6cc1\u3092\u4e0a\u304b\u3089\u30c8\u30ec\u30fc\u30b9\u3059\u308b\u3053\u3068\u3067\u539f\u56e0\u304c\u7279\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30a8\u30e9\u30fc9\u306e\u5178\u578b\u30d1\u30bf\u30fc\u30f3\u3068\u5bfe\u51e6\u6cd5\n\n&#x27; \u30d1\u30bf\u30fc\u30f31\uff1aReDim\u524d\u306b\u30a2\u30af\u30bb\u30b9\nDim arr() As Integer\n&#x27; arr(0) = 10  &#x27; \u2190 \u30a8\u30e9\u30fc9\uff01\u3000ReDim\u304c\u307e\u3060\nReDim arr(9)\narr(0) = 10   &#x27; OK\n\n&#x27; \u30d1\u30bf\u30fc\u30f32\uff1aErase\u5f8c\u306b\u30a2\u30af\u30bb\u30b9\nReDim arr(9)\narr(0) = 50\nErase arr     &#x27; \u53ef\u5909\u9577\u914d\u5217\u306f\u89e3\u653e\u3055\u308c\u308b\n&#x27; arr(0) = 10  &#x27; \u2190 \u30a8\u30e9\u30fc9\uff01\u3000\u518d\u5ea6ReDim\u304c\u5fc5\u8981\nReDim arr(9)\narr(0) = 10   &#x27; OK\n\n&#x27; \u30d1\u30bf\u30fc\u30f33\uff1a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30aa\u30fc\u30d0\u30fc\nReDim arr(4)  &#x27; 0\u301c4\u306e5\u8981\u7d20\n&#x27; arr(5) = 99  &#x27; \u2190 \u30a8\u30e9\u30fc9\uff01\u3000\u4e0a\u9650\u306f4\narr(4) = 99   &#x27; OK\n\n&#x27; \u5b89\u5168\u306a\u30a2\u30af\u30bb\u30b9\u30d1\u30bf\u30fc\u30f3\nIf UBound(arr) &gt;= 5 Then\n    arr(5) = 99\nEnd If<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">\u9632\u5fa1\u7684\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\uff1a\u30a2\u30af\u30bb\u30b9\u524d\u306bUBound\u3067\u78ba\u8a8d<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u300c\u3053\u306e\u914d\u5217\u306b\u30c7\u30fc\u30bf\u306f\u5165\u3063\u3066\u3044\u308b\u304b\u300d\u3092\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u3001VBA\u306b\u306f\u5c02\u7528\u306e\u95a2\u6570\u304c\u306a\u3044\u305f\u3081\u3001On Error Resume Next\u3092\u4f7f\u3046\u304b\u3001\u30ab\u30a6\u30f3\u30bf\u30fc\u5909\u6570\u3067\u4ef6\u6570\u3092\u7ba1\u7406\u3059\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002\u914d\u5217\u304cReDim\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u300cIf Not IsEmpty(arr) Then\u300d\uff08Variant\u578b\u306e\u5834\u5408\uff09\u307e\u305f\u306f\u4ef6\u6570\u7ba1\u7406\u5909\u6570\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8-2. \u9632\u5fa1\u7684\u306a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u5b89\u5168\u306a\u914d\u5217\u51e6\u7406\u306e\u5b9a\u578b\u30d1\u30bf\u30fc\u30f3\nSub SafeArrayProcess()\n    Dim data() As String\n    Dim count As Long\n    count = 0  &#x27; \u4ef6\u6570\u7ba1\u7406\u5909\u6570\uff08\u914d\u5217\u306e\u6709\u52b9\u8981\u7d20\u6570\u3092\u5225\u9014\u7ba1\u7406\uff09\n\n    &#x27; ...\u30c7\u30fc\u30bf\u53ce\u96c6\u51e6\u7406...\n    &#x27; count &gt; 0 \u306e\u5834\u5408\u306e\u307f\u3001data(0)\u301cdata(count-1)\u304c\u6709\u52b9\n\n    &#x27; \u4ef6\u6570\u30c1\u30a7\u30c3\u30af\u3057\u3066\u304b\u3089\u51e6\u7406\n    If count = 0 Then\n        MsgBox &quot;\u30c7\u30fc\u30bf\u304c\u3042\u308a\u307e\u305b\u3093&quot;\n        Exit Sub\n    End If\n\n    &#x27; \u5b89\u5168\u306b\u30eb\u30fc\u30d7\n    Dim i As Long\n    For i = 0 To count - 1  &#x27; count\u3067\u7ba1\u7406\uff08UBound\u3088\u308a\u5b89\u5168\uff09\n        Debug.Print data(i)\n    Next i\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3082\u3042\u308f\u3066\u306a\u3044\u3053\u3068\u3002Claude Code\u306b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u8a72\u5f53\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u8cbc\u308a\u4ed8\u3051\u3066\u300c\u3053\u306e\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5\u3092\u6559\u3048\u3066\u300d\u3068\u805e\u3051\u3070\u3001\u5373\u5ea7\u306b\u30d4\u30f3\u30dd\u30a4\u30f3\u30c8\u3067\u56de\u7b54\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u81ea\u529b\u3067\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u3088\u308a10\u500d\u901f\u3044\u5834\u5408\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u30a8\u30e9\u30fc9\u306e\u78ba\u8a8d\uff1a\u5bfe\u8c61\u914d\u5217\u306eReDim\u304c\u6e08\u3093\u3067\u3044\u308b\u304b\u3001Erase\u3067\u89e3\u653e\u6e08\u307f\u3067\u306a\u3044\u304b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u30a8\u30e9\u30fc13\u306e\u78ba\u8a8d\uff1aArray\u95a2\u6570\u306e\u53d7\u3051\u53d6\u308a\u5909\u6570\u304cVariant\u578b\u304b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u300c\u3059\u3067\u306b\u6b21\u5143\u5316\u300d\uff1a\u56fa\u5b9a\u9577\u914d\u5217\u306bReDim\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u306a\u3044\u304b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u591a\u6b21\u5143\u914d\u5217Preserve\u5931\u6557\uff1a\u6700\u5f8c\u306e\u6b21\u5143\u4ee5\u5916\u3092\u5909\u66f4\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u306a\u3044\u304b<\/span><\/div>\n\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-09\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">09<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CLAUDE CODE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Claude Code\u3067VBA\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b<\/span>\n  <span class=\"section-desc\">AI\u6d3b\u7528\u3067VBA\u306e\u58c1\u3092\u8d8a\u3048\u308b\uff1a\u975e\u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3082\u30de\u30af\u30ed\u304c\u66f8\u3051\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u307e\u3067\u8aad\u3093\u3067\u300cVBA\u306e\u914d\u5217\u306f\u7406\u89e3\u3067\u304d\u3066\u304d\u305f\u304c\u3001\u81ea\u5206\u3067\u30bc\u30ed\u304b\u3089\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u306f\u307e\u3060\u30cf\u30fc\u30c9\u30eb\u304c\u9ad8\u3044\u300d\u3068\u611f\u3058\u3066\u3044\u308b\u65b9\u3082\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u305d\u3053\u3067\u5f0a\u793e\u304c\u5b9f\u8df5\u3057\u3066\u3044\u308b\u306e\u304c\u3001<strong>Claude Code\u3092\u6d3b\u7528\u3057\u305fVBA\u30b3\u30fc\u30c9\u306e\u81ea\u52d5\u751f\u6210<\/strong>\u3067\u3059\u3002\u914d\u5217\u51e6\u7406\u306e\u3088\u3046\u306a\u5c11\u3057\u8907\u96d1\u306a\u30b3\u30fc\u30c9\u3082\u3001\u696d\u52d9\u306e\u8981\u4ef6\u3092\u65e5\u672c\u8a9e\u3067\u8aac\u660e\u3059\u308b\u3060\u3051\u3067Claude Code\u304c\u6b63\u78ba\u306b\u66f8\u3044\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Claude Code\u306f\u30bf\u30fc\u30df\u30ca\u30eb\uff08\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\uff09\u4e0a\u3067\u52d5\u304fAI\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3067\u3059\u304c\u3001VBA\u306e\u30b3\u30fc\u30c9\u751f\u6210\u306b\u304a\u3044\u3066\u306f\u300c\u81ea\u7136\u306a\u65e5\u672c\u8a9e\u3067\u696d\u52d9\u8981\u4ef6\u3092\u8aac\u660e\u2192\u914d\u5217\u3092\u4f7f\u3063\u305f\u6700\u9069\u306aVBA\u30b3\u30fc\u30c9\u3092\u751f\u6210\u300d\u3068\u3044\u3046\u5f62\u3067\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002ReDim\u3092\u4f7f\u3046\u3079\u304d\u304bReDim Preserve\u3092\u4f7f\u3046\u3079\u304d\u304b\u30012\u6b21\u5143\u914d\u5217\u304c\u9069\u5207\u304b\u3069\u3046\u304b\u3001\u3068\u3044\u3046\u8a2d\u8a08\u5224\u65ad\u307e\u3067\u542b\u3081\u3066AI\u304c\u8003\u3048\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u3067\u306f\u793e\u5185\u306e\u5728\u5eab\u7ba1\u7406\u30fb\u58f2\u4e0a\u96c6\u8a08\u30fb\u9867\u5ba2\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u306a\u3069\u306eExcel\u696d\u52d9\u30de\u30af\u30ed\u3092\u307b\u307c\u5168\u3066Claude Code\u306b\u66f8\u304b\u305b\u3066\u3044\u307e\u3059\u3002\u300cA\u5217\u306e\u9867\u5ba2\u30b3\u30fc\u30c9\u3067\u91cd\u8907\u6392\u9664\u3057\u3066B\u5217\u306e\u91d1\u984d\u3092\u5408\u7b97\u3059\u308b\u30de\u30af\u30ed\u3092\u914d\u5217\u3092\u4f7f\u3063\u3066\u9ad8\u901f\u306b\u66f8\u3044\u3066\u300d\u3068\u8a00\u3046\u3060\u3051\u3067\u3001ReDim Preserve\u307e\u3067\u4f7f\u3063\u305f\u672c\u683c\u7684\u306a\u30b3\u30fc\u30c9\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9-1. Claude Code\u3078\u306e\u52b9\u679c\u7684\u306a\u6307\u793a\u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u914d\u5217\u3092\u4f7f\u3063\u305f\u30b3\u30fc\u30c9\u751f\u6210\u3092Claude Code\u306b\u4f9d\u983c\u3059\u308b\u969b\u306e\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u696d\u52d9\u306e\u30b4\u30fc\u30eb\u3068\u300c\u30c7\u30fc\u30bf\u306e\u6027\u8cea\u300d\u3092\u30bb\u30c3\u30c8\u3067\u4f1d\u3048\u308b\u3053\u3068\u3067\u3059\u3002\u4ef6\u6570\u304c\u6bce\u56de\u5909\u308f\u308b\u306e\u304b\u56fa\u5b9a\u306a\u306e\u304b\u30012\u6b21\u5143\u30c7\u30fc\u30bf\u306a\u306e\u304b1\u6b21\u5143\u306a\u306e\u304b\u2014\u2014\u3053\u3046\u3057\u305f\u60c5\u5831\u3092\u4f1d\u3048\u308b\u3053\u3068\u3067\u3001Claude Code\u304c\u56fa\u5b9a\u9577\u304b\u53ef\u5909\u9577\u304b\u3001ReDim\u304bReDim Preserve\u304b\u3092\u9069\u5207\u306b\u5224\u65ad\u3057\u3066\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u300c\u4f55\u3092\u3057\u305f\u3044\u304b\u300d\u3092\u696d\u52d9\u306e\u8a00\u8449\u3067\u8aac\u660e\u3059\u308b\uff08\u4f8b\uff1a\u300c\u6bce\u6708\u306eExcel\u58f2\u4e0a\u30b7\u30fc\u30c8\u3092\u9867\u5ba2\u5225\u306b\u96c6\u8a08\u3057\u305f\u3044\u300d\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u300c\u4ef6\u6570\u304c\u6bce\u6708\u5909\u308f\u308b\u300d\u300c\u5e38\u306b12\u884c\u56fa\u5b9a\u300d\u306a\u3069\u3001\u30c7\u30fc\u30bf\u306e\u5909\u52d5\u6027\u3092\u4f1d\u3048\u308b\uff08\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u5224\u65ad\u306b\u76f4\u7d50\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u300c\u51e6\u7406\u5f8c\u306b\u7d50\u679c\u3092\u5225\u30b7\u30fc\u30c8\u306b\u66f8\u304d\u51fa\u3057\u305f\u3044\u300d\u306a\u3069\u51fa\u529b\u5148\u3082\u660e\u793a\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306e\u65e5\u672c\u8a9e\u30b3\u30e1\u30f3\u30c8\u3092\u8aad\u3093\u3067\u3001\u4f55\u3092\u3057\u3066\u3044\u308b\u304b\u3092\u7406\u89e3\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span>\u52d5\u304b\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3054\u3068Claude\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u300c\u306a\u305c\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u304b\u300d\u3092\u805e\u304f<\/span><\/div>\n\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Claude Code\u3078\u306e\u6307\u793a\u4f8b\uff08\u5165\u529b\u30c6\u30ad\u30b9\u30c8\uff09\n&#x27; \u300cExcel\u306eSheet1\u306b\u3042\u308bA\u5217\uff08\u9867\u5ba2\u540d\uff09B\u5217\uff08\u58f2\u4e0a\u984d\uff09\u306e\u30c7\u30fc\u30bf\u3092\n&#x27;  \u9867\u5ba2\u540d\u3054\u3068\u306b\u58f2\u4e0a\u3092\u5408\u7b97\u3057\u3066Sheet2\u306b\u51fa\u529b\u3059\u308bVBA\u30de\u30af\u30ed\u3092\u3001\n&#x27;  \u914d\u5217\u3068Dictionary\u3092\u4f7f\u3063\u3066\u9ad8\u901f\u306b\u66f8\u3044\u3066\u304f\u3060\u3055\u3044\u3002\n&#x27;  \u30c7\u30fc\u30bf\u4ef6\u6570\u306f\u6bce\u6708\u5909\u308f\u308a\u307e\u3059\u3002\u300d\n&#x27;\n&#x27; \u2192 Claude Code\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6700\u9069\u306a\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\n&#x27;    \uff08\u5b9f\u969b\u306b\u306f\u3082\u3063\u3068\u8a73\u7d30\u306a\u30b3\u30e1\u30f3\u30c8\u4ed8\u304d\u3067\u751f\u6210\u3055\u308c\u308b\uff09\n\nSub SumSalesByCustomer()\n    &#x27; \u53ef\u5909\u9577\u914d\u5217+Dictionary\u3067\u9867\u5ba2\u5225\u96c6\u8a08\n    Dim ws1 As Worksheet, ws2 As Worksheet\n    Set ws1 = ThisWorkbook.Sheets(&quot;Sheet1&quot;)\n    Set ws2 = ThisWorkbook.Sheets(&quot;Sheet2&quot;)\n\n    Dim lastRow As Long\n    lastRow = ws1.Cells(ws1.Rows.Count, 1).End(xlUp).Row\n\n    &#x27; \u4e00\u62ec\u8aad\u307f\u8fbc\u307f\uff08\u9ad8\u901f\u5316\uff09\n    Dim data As Variant\n    data = ws1.Range(&quot;A2:B&quot; &amp; lastRow).Value\n\n    &#x27; Dictionary\u3067\u9867\u5ba2\u5225\u96c6\u8a08\n    Dim dict As Object\n    Set dict = CreateObject(&quot;Scripting.Dictionary&quot;)\n\n    Dim r As Long\n    For r = 1 To UBound(data, 1)\n        Dim key As String\n        key = CStr(data(r, 1))\n        If dict.Exists(key) Then\n            dict(key) = dict(key) + data(r, 2)\n        Else\n            dict.Add key, data(r, 2)\n        End If\n    Next r\n\n    &#x27; \u7d50\u679c\u3092\u914d\u5217\u306b\u683c\u7d0d\u3057\u3066\u4e00\u62ec\u66f8\u304d\u51fa\u3057\n    Dim resultCount As Long\n    resultCount = dict.Count\n    Dim results() As Variant\n    ReDim results(resultCount - 1, 1)\n\n    Dim i As Long\n    i = 0\n    Dim k As Variant\n    For Each k In dict.Keys\n        results(i, 0) = k\n        results(i, 1) = dict(k)\n        i = i + 1\n    Next k\n\n    ws2.Range(&quot;A2&quot;).Resize(resultCount, 2).Value = results\n    MsgBox &quot;\u96c6\u8a08\u5b8c\u4e86\uff1a&quot; &amp; resultCount &amp; &quot;\u9867\u5ba2&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">Claude Code\u306b\u300c\u306a\u305c\u3053\u306e\u30b3\u30fc\u30c9\u306b\u3057\u305f\u304b\u300d\u3082\u805e\u304f<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u305f\u3089\u300c\u306a\u305cReDim\u3067\u306f\u306a\u304fDictionary\u3092\u4f7f\u3063\u305f\u306e\u304b\u300d\u300c\u53ef\u5909\u9577\u914d\u5217\u3092\u9078\u3093\u3060\u7406\u7531\u306f\uff1f\u300d\u3068\u8ffd\u52a0\u3067\u805e\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002Claude Code\u306f\u8a2d\u8a08\u5224\u65ad\u306e\u6839\u62e0\u3082\u65e5\u672c\u8a9e\u3067\u8aac\u660e\u3057\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u30b3\u30fc\u30c9\u3092\u8aad\u3080\u3060\u3051\u3067\u306a\u304f\u3001\u306a\u305c\u305d\u3046\u66f8\u304f\u306e\u304b\u306e\u7406\u89e3\u3082\u540c\u6642\u306b\u6df1\u307e\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300cVBA\u304c\u66f8\u3051\u306a\u304f\u3066\u3082\u3001\u696d\u52d9\u30de\u30af\u30ed\u3092\u4f5c\u308c\u305f\u300d\u3068\u3044\u3046\u4f53\u9a13\u304c\u5b66\u7fd2\u306e\u6700\u77ed\u30eb\u30fc\u30c8\u3067\u3059\u3002Claude Code\u306b\u66f8\u3044\u3066\u3082\u3089\u3063\u305f\u30b3\u30fc\u30c9\u3092\u8aad\u3093\u3067\u30b3\u30e1\u30f3\u30c8\u3092\u7406\u89e3\u3059\u308b\u2014\u2014\u3053\u306e\u7e70\u308a\u8fd4\u3057\u3067\u3001\u81ea\u7136\u306bVBA\u306e\u914d\u5217\u306e\u4f7f\u3044\u65b9\u3082\u8eab\u306b\u3064\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u975e\u30a8\u30f3\u30b8\u30cb\u30a2\u306e\u7d4c\u55b6\u8005\u30fb\u7ba1\u7406\u8077\u306e\u65b9\u304cClaude Code\u3092\u6d3b\u7528\u3057\u3066VBA\u3092\u81ea\u52d5\u5316\u3059\u308b\u30b9\u30c6\u30c3\u30d7\u3092\u6574\u7406\u3059\u308b\u3068\u3001\u300c\u696d\u52d9\u8ab2\u984c\u306e\u5b9a\u7fa9\uff08\u4f55\u304c\u9762\u5012\u306a\u306e\u304b\uff09\u2192Claude Code\u3078\u306e\u65e5\u672c\u8a9e\u6307\u793a\u2192\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u3092\u793e\u5185Excel\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u5b9f\u884c\u2192\u52d5\u4f5c\u78ba\u8a8d\u2192\u6539\u5584\u70b9\u304c\u3042\u308c\u3070\u8ffd\u52a0\u6307\u793a\u300d\u3068\u3044\u3046\u30b5\u30a4\u30af\u30eb\u306b\u306a\u308a\u307e\u3059\u3002\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u77e5\u8b58\u304c\u306a\u304f\u3066\u3082\u3001\u696d\u52d9\u306e\u8981\u4ef6\u3092\u8a00\u8a9e\u5316\u3067\u304d\u308c\u3070\u81ea\u52d5\u5316\u304c\u5b9f\u73fe\u3067\u304d\u308b\u6642\u4ee3\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5f0a\u793e\uff08\u682a\u5f0f\u4f1a\u793eGENAI\uff09\u3067\u306f\u3001\u3053\u3046\u3057\u305fClaude Code\u3092\u6d3b\u7528\u3057\u305f\u696d\u52d9\u81ea\u52d5\u5316\u306e\u8a2d\u8a08\u30fb\u5b9f\u88c5\u652f\u63f4\u3092\u300cAI\u9b3c\u7ba1\u7406\u300d\u3068\u3057\u3066\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-array-init&#038;blog_slug=cc-vba-array-init\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-array-init&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-10\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">10<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CONCLUSION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u307e\u3068\u3081<\/span>\n  <span class=\"section-desc\">VBA\u914d\u5217\u306e\u521d\u671f\u5316\u3092\u5b8c\u5168\u306b\u4f7f\u3044\u3053\u306a\u3059\u305f\u3081\u306b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u914d\u5217\u306e\u521d\u671f\u5316\u65b9\u6cd5\u30924\u3064\u306e\u624b\u6bb5\u2014\u2014Erase\u30fbArray\u95a2\u6570\u30fbReDim\u30fbReDim Preserve\u2014\u2014\u306b\u5206\u3051\u3066\u5b8c\u5168\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u6700\u5f8c\u306b\u30dd\u30a4\u30f3\u30c8\u3092\u632f\u308a\u8fd4\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u56fa\u5b9a\u9577\u914d\u5217\uff08Dim arr(N)\uff09<\/strong>\uff1a\u8981\u7d20\u6570\u56fa\u5b9a\u3002Erase\u3067\u5168\u8981\u7d20\u30ea\u30bb\u30c3\u30c8\uff08\u30b5\u30a4\u30ba\u7dad\u6301\uff09\u3002ReDim\u306f\u4f7f\u7528\u4e0d\u53ef<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u53ef\u5909\u9577\u914d\u5217\uff08Dim arr()\uff09<\/strong>\uff1a\u8981\u7d20\u6570\u306f\u5f8c\u304b\u3089ReDim\u3067\u8a2d\u5b9a\u3002Erase\u3067\u30e1\u30e2\u30ea\u89e3\u653e\uff08Erase\u5f8c\u306fReDim\u304c\u5fc5\u8981\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Erase<\/strong>\uff1a\u5168\u8981\u7d20\u30ea\u30bb\u30c3\u30c8\uff08\u56fa\u5b9a\u9577\uff09\u307e\u305f\u306f\u30e1\u30e2\u30ea\u89e3\u653e\uff08\u53ef\u5909\u9577\uff09\u3002\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u3067\u6319\u52d5\u304c\u9055\u3046\u3053\u3068\u3092\u5fc5\u305a\u899a\u3048\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Array\u95a2\u6570<\/strong>\uff1a\u5024\u3092\u4e00\u62ec\u4ee3\u5165\u3002\u53d7\u3051\u53d6\u308a\u5909\u6570\u306fVariant\u578b\u5fc5\u9808\u3002\u30de\u30b9\u30bf\u30fc\u30c7\u30fc\u30bf\u5b9a\u7fa9\u306b\u6700\u9069<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>ReDim<\/strong>\uff1a\u53ef\u5909\u9577\u914d\u5217\u306e\u8981\u7d20\u6570\u3092\u5b9f\u884c\u6642\u306b\u8a2d\u5b9a\u30fb\u5909\u66f4\u3002\u5b9f\u884c\u3059\u308b\u305f\u3073\u306b\u30c7\u30fc\u30bf\u304c\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>ReDim Preserve<\/strong>\uff1a\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3057\u305f\u307e\u307e\u8981\u7d20\u6570\u3092\u5909\u66f4\u3002\u591a\u6b21\u5143\u914d\u5217\u306f\u6700\u5f8c\u306e\u6b21\u5143\u306e\u307f\u5909\u66f4\u53ef<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u9ad8\u901f\u5316\u306e\u5b9a\u77f3<\/strong>\uff1aRange.Value\u3067\u4e00\u62ec\u8aad\u307f\u8fbc\u307f\u2192\u914d\u5217\u51e6\u7406\u2192Range.Value\u3067\u4e00\u62ec\u66f8\u304d\u8fbc\u307f<\/span><\/div>\n\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u914d\u5217\u306e\u521d\u671f\u5316\u3092\u6b63\u78ba\u306b\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001VBA\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3068\u51e6\u7406\u901f\u5ea6\u304c\u683c\u6bb5\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002\u300c\u306a\u3093\u3068\u306a\u304f\u52d5\u3044\u3066\u3044\u308b\u304c\u3001\u6642\u3005\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u300d\u3068\u3044\u3046\u72b6\u6cc1\u306f\u3001\u307b\u3068\u3093\u3069\u306e\u5834\u5408\u304cErase\u3068ReDim\u306e\u4f7f\u3044\u5206\u3051\u306e\u7406\u89e3\u4e0d\u8db3\u304b\u3001\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u6df7\u540c\u304b\u3089\u6765\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u6574\u7406\u3057\u305f4\u3064\u306e\u521d\u671f\u5316\u65b9\u6cd5\u3092\u30de\u30b9\u30bf\u30fc\u3059\u308c\u3070\u3001\u305d\u3046\u3057\u305f\u554f\u984c\u304b\u3089\u89e3\u653e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u914d\u5217\u3092\u6b63\u3057\u304f\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3068\u3001\u696d\u52d9Excel\u306e\u30de\u30af\u30ed\u304c\u5287\u7684\u306b\u901f\u304f\u306a\u308a\u307e\u3059\u3002\u5f0a\u793e\u3067\u306f\u6708\u6b21\u96c6\u8a08\u51e6\u7406\u304c20\u5206\u21921\u5206\u4ee5\u5185\u306b\u306a\u3063\u305f\u4e8b\u4f8b\u304c\u8907\u6570\u3042\u308a\u307e\u3059\u3002\u914d\u5217\u306e\u4e00\u62ec\u5165\u51fa\u529b\u30d1\u30bf\u30fc\u30f3\u3092\u4e00\u5ea6\u899a\u3048\u308c\u3070\u3001\u3069\u3093\u306a\u30c7\u30fc\u30bf\u91cf\u3067\u3082\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u30b3\u30fc\u30c9\u3092\u81ea\u5206\u3067\u66f8\u304f\u306e\u304c\u96e3\u3057\u3044\u5834\u5408\u306f\u3001Claude Code\u306b\u696d\u52d9\u306e\u8981\u4ef6\u3092\u65e5\u672c\u8a9e\u3067\u8aac\u660e\u3059\u308b\u3060\u3051\u3067\u3001\u914d\u5217\u3092\u4f7f\u3063\u305f\u6700\u9069\u306a\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3067\u304d\u307e\u3059\u3002\u300cVBA\u306f\u96e3\u3057\u3044\u300d\u3067\u306f\u306a\u304f\u3001\u300cAI\u3092\u3046\u307e\u304f\u4f7f\u3048\u3070\u975e\u30a8\u30f3\u30b8\u30cb\u30a2\u3067\u3082\u696d\u52d9\u81ea\u52d5\u5316\u304c\u3067\u304d\u308b\u300d\u3068\u3044\u3046\u6642\u4ee3\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5f0a\u793e\u306eAI\u9b3c\u7ba1\u7406\u3067\u306f\u3001\u3053\u3046\u3057\u305f\u81ea\u52d5\u5316\u8a2d\u8a08\u306e\u7121\u6599\u76f8\u8ac7\u3092\u627f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">VBA\u306e\u696d\u52d9\u81ea\u52d5\u5316\u3092\u3001AI\u9b3c\u7ba1\u7406\u304c\u4e00\u7dd2\u306b\u8a2d\u8a08\u3057\u307e\u3059<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cExcel\u30de\u30af\u30ed\u3067\u696d\u52d9\u3092\u81ea\u52d5\u5316\u3057\u305f\u3044\u304c\u3001VBA\u304c\u96e3\u3057\u3044\u300d\u300c\u914d\u5217\u3092\u4f7f\u3063\u305f\u9ad8\u901f\u51e6\u7406\u3092\u81ea\u793e\u306b\u53d6\u308a\u5165\u308c\u305f\u3044\u300d\u3068\u3044\u3046\u65b9\u306b\u5411\u3051\u3066\u3001\u5f0a\u793e\u3067\u306fClaude Code\u3092\u6d3b\u7528\u3057\u305f\u696d\u52d9\u81ea\u52d5\u5316\u306e\u8a2d\u8a08\u304b\u3089\u5b9f\u88c5\u652f\u63f4\u307e\u3067\u884c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u300c\u4f55\u304b\u3089\u59cb\u3081\u308c\u3070\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u65b9\u3082\u3001\u307e\u305a\u306f\u7121\u6599\u76f8\u8ac7\u3067\u73fe\u72b6\u306e\u696d\u52d9\u30d5\u30ed\u30fc\u3092\u304a\u805e\u304b\u305b\u304f\u3060\u3055\u3044\u3002VBA\u3067\u81ea\u52d5\u5316\u3067\u304d\u308b\u90e8\u5206\u30fbClaude Code\u306b\u4efb\u305b\u308b\u3079\u304d\u90e8\u5206\u3092\u6574\u7406\u3057\u3066\u3001\u6700\u77ed\u3067\u6210\u679c\u304c\u51fa\u308b\u30d7\u30e9\u30f3\u3092\u3054\u63d0\u6848\u3057\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);border-radius:16px;padding:36px 32px;margin:48px 0 16px;color:#fff;\">\n  <p style=\"font-size:13px;font-weight:700;color:#dc2626;letter-spacing:2px;margin:0 0 12px;\">NEXT STEP<\/p>\n  <p style=\"font-size:22px;font-weight:800;line-height:1.5;margin:0 0 20px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u3092\u3001\u3042\u306a\u305f\u306e\u30d3\u30b8\u30cd\u30b9\u3067<br>\u5b9f\u8df5\u3057\u3066\u307f\u307e\u305b\u3093\u304b\uff1f<\/p>\n  <div style=\"background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);border-radius:12px;padding:24px;max-width:560px;margin:0 auto;\">\n    <p style=\"font-size:13px;color:#dc2626;font-weight:700;margin:0 0 8px;\">AI\u6d3b\u7528\u3092\u81ea\u793e\u3067\u56de\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u65b9\u3078<\/p>\n    <p style=\"font-size:20px;font-weight:800;margin:0 0 12px;\">AI\u9b3c\u7ba1\u7406<\/p>\n    <p style=\"font-size:14px;color:rgba(255,255,255,0.75);margin:0 0 20px;line-height:1.7;\">Claude Code\u30fbCowork\u5c0e\u5165\u652f\u63f4\u304b\u3089\u696d\u52d9\u8a2d\u8a08\u30fb\u793e\u5185\u6d78\u900f\u307e\u3067\u5b9f\u8df5\u30d9\u30fc\u30b9\u3067\u4f34\u8d70\u3002\u300c\u81ea\u793e\u3067\u56de\u305b\u308b\u7d44\u7e54\u300d\u309290\u65e5\u3067\u4f5c\u308b\u7d4c\u55b6\u8005\u5411\u3051\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3002<\/p>\n    <div style=\"text-align:center;\">\n      <a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&utm_medium=article&utm_campaign=cc-vba-array-init&utm_content=next-step-cta\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#dc2626;color:#fff;font-weight:700;font-size:15px;padding:14px 32px;border-radius:30px;text-decoration:none;\">AI\u9b3c\u7ba1\u7406\u3092\u8a73\u3057\u304f\u898b\u308b \u2192<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. VBA\u306e\u914d\u5217\u3068\u5909\u6570\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u5909\u6570\u306f1\u3064\u306e\u5024\u3057\u304b\u683c\u7d0d\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u914d\u5217\u306f\u540c\u3058\u30c7\u30fc\u30bf\u578b\u306e\u8907\u6570\u306e\u5024\u3092\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u7ba1\u7406\u3067\u304d\u307e\u3059\u300210\u4eba\u306e\u7d66\u4e0e\u3092\u7ba1\u7406\u3059\u308b\u3068\u304d\u3001\u5909\u6570\u304c10\u500b\u5fc5\u8981\u306a\u3068\u3053\u308d\u3092\u914d\u52171\u3064\u3067\u5bfe\u5fdc\u3067\u304d\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3067\u304d\u307e\u3059\u3002\u914d\u5217\u306f\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u5897\u3048\u3066\u3082\u30b3\u30fc\u30c9\u3092\u5909\u3048\u305a\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u70b9\u304c\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Erase\u3068ReDim\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u5178\u578b\u7684\u306a\u4f7f\u3044\u65b9\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u30eb\u30fc\u30d7\u51e6\u7406\u306e\u9014\u4e2d\u3067\u300c\u4e00\u5ea6\u5168\u30c7\u30fc\u30bf\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u6700\u521d\u304b\u3089\u5165\u308c\u76f4\u3059\u300d\u5834\u9762\u3067Erase+ReDim\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u300c\u6708\u6b21\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u524d\u6708\u306e\u30c7\u30fc\u30bf\u3092\u6d88\u53bb\u3057\u3066\u304b\u3089\u4eca\u6708\u306e\u30c7\u30fc\u30bf\u3092\u518d\u683c\u7d0d\u3059\u308b\u300d\u51e6\u7406\u3067\u306f\u3001\u53ef\u5909\u9577\u914d\u5217\u306bErase\uff08\u89e3\u653e\uff09\u2192ReDim\uff08\u4eca\u6708\u306e\u4ef6\u6570\u3067\u518d\u78ba\u4fdd\uff09\u2192\u30c7\u30fc\u30bf\u683c\u7d0d\u3001\u3068\u3044\u3046\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u914d\u5217\u306e\u8981\u7d20\u6570\uff08\u4ef6\u6570\uff09\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. UBound(\u914d\u5217\u540d)\u3067\u6700\u5927\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3001LBound(\u914d\u5217\u540d)\u3067\u6700\u5c0f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u8981\u7d20\u6570\u306f\u300cUBound(arr) - LBound(arr) + 1\u300d\u3067\u8a08\u7b97\u3057\u307e\u3059\u30020\u59cb\u307e\u308a\u306a\u3089\u300cUBound(arr) + 1\u300d\u3067\u3082\u540c\u3058\u3067\u3059\u30022\u6b21\u5143\u914d\u5217\u306e\u5834\u5408\u306fUBound(arr, 1)\u3067\u884c\u6570\u3001UBound(arr, 2)\u3067\u5217\u6570\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Dictionary\u3084Collection\u3068\u914d\u5217\u306f\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\u3079\u304d\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u914d\u5217\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u6570\u5024\uff09\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u9806\u5e8f\u4ed8\u304d\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3059\u3002Dictionary\u306f\u30ad\u30fc\uff08\u6587\u5b57\u5217\u306a\u3069\uff09\u3067\u9ad8\u901f\u691c\u7d22\u304c\u3067\u304d\u307e\u3059\u3002\u300c\u9867\u5ba2ID\u3067\u58f2\u4e0a\u3092\u96c6\u8a08\u3059\u308b\u300d\u3088\u3046\u306a\u300c\u30ad\u30fc\u3067\u691c\u7d22\u30fb\u96c6\u7d04\u300d\u304c\u5fc5\u8981\u306a\u51e6\u7406\u306fDictionary\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u65b9\u300cExcel\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u884c\u756a\u53f7\u30fb\u5217\u756a\u53f7\u3067\u305d\u306e\u307e\u307e\u6271\u3046\u300d\u3088\u3046\u306a\u300c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30a2\u30af\u30bb\u30b9\u3068\u4e00\u62ec\u5165\u51fa\u529b\u300d\u304c\u4e2d\u5fc3\u306a\u3089\u914d\u5217\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. 2\u6b21\u5143\u914d\u5217\u3092\u5168\u4ef6\u30eb\u30fc\u30d7\u3059\u308b\u306b\u306f\u3069\u3046\u66f8\u3051\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. For r = LBound(arr, 1) To UBound(arr, 1): For c = LBound(arr, 2) To UBound(arr, 2): \u51e6\u7406 : Next c: Next r \u3068\u3044\u3046\u4e8c\u91cd\u30eb\u30fc\u30d7\u304c\u57fa\u672c\u3067\u3059\u3002LBound\/UBound\u306b\u7b2c2\u5f15\u6570\uff08\u6b21\u5143\u756a\u53f7\uff09\u3092\u6e21\u3059\u3053\u3068\u3067\u884c\u6570\u30fb\u5217\u6570\u305d\u308c\u305e\u308c\u306e\u4e0a\u9650\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002Range.Value\u3067\u53d6\u5f97\u3057\u305f\u914d\u5217\u306f1\u59cb\u307e\u308a\u306a\u306e\u3067LBound\u306f1\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\uff08\u30b5\u30a4\u30ba\uff09\u306b\u5236\u9650\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. VBA\u306e\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\u306f\u3001\u5229\u7528\u53ef\u80fd\u306a\u30e1\u30e2\u30ea\u91cf\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002\u7406\u8ad6\u4e0a\u306f\u6574\u6570\u306e\u6700\u5927\u5024\uff08\u7d0421\u5104\uff09\u307e\u3067\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306f\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u304f\u306a\u308b\u524d\u306b\u300c\u30e1\u30e2\u30ea\u304c\u4e0d\u8db3\u3057\u3066\u3044\u307e\u3059\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u901a\u5e38\u306e\u696d\u52d9\u51e6\u7406\uff08100\u4e07\u884c\u4ee5\u4e0b\uff09\u3067\u3042\u308c\u3070\u5236\u9650\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. VBA\u306e\u30b3\u30fc\u30c9\u3092\u30bc\u30ed\u304b\u3089\u66f8\u304f\u306e\u304c\u96e3\u3057\u3044\u306e\u3067\u3059\u304c\u3001AI\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u751f\u6210\u3067\u304d\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u3067\u304d\u307e\u3059\u3002Claude Code\u306b\u300cExcel\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u3067\u51e6\u7406\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u696d\u52d9\u8981\u4ef6\u3092\u65e5\u672c\u8a9e\u3067\u8aac\u660e\u3059\u308b\u3068\u3001\u914d\u5217\u5ba3\u8a00\u30fbReDim\u30fb\u30eb\u30fc\u30d7\u51e6\u7406\u30fb\u4e00\u62ec\u5165\u51fa\u529b\u307e\u3067\u542b\u3093\u3060\u5b8c\u5168\u306aVBA\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u4ef6\u6570\u304c\u5909\u52d5\u3059\u308b\u304b\u56fa\u5b9a\u304b\u3092\u4f1d\u3048\u308b\u3068\u3001\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u9078\u629e\u3082\u81ea\u52d5\u5224\u65ad\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"VBA\u306e\u914d\u5217\u3068\u5909\u6570\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u5909\u6570\u306f1\u3064\u306e\u5024\u3057\u304b\u683c\u7d0d\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u914d\u5217\u306f\u540c\u3058\u30c7\u30fc\u30bf\u578b\u306e\u8907\u6570\u306e\u5024\u3092\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3067\u7ba1\u7406\u3067\u304d\u307e\u3059\u300210\u4eba\u306e\u7d66\u4e0e\u3092\u7ba1\u7406\u3059\u308b\u3068\u304d\u3001\u5909\u6570\u304c10\u500b\u5fc5\u8981\u306a\u3068\u3053\u308d\u3092\u914d\u52171\u3064\u3067\u5bfe\u5fdc\u3067\u304d\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u7684\u306b\u51e6\u7406\u3067\u304d\u307e\u3059\u3002\u914d\u5217\u306f\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u5897\u3048\u3066\u3082\u30b3\u30fc\u30c9\u3092\u5909\u3048\u305a\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u70b9\u304c\u6700\u5927\u306e\u30e1\u30ea\u30c3\u30c8\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Erase\u3068ReDim\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u5178\u578b\u7684\u306a\u4f7f\u3044\u65b9\u306f\u3042\u308a\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u9014\u4e2d\u3067\u300c\u4e00\u5ea6\u5168\u30c7\u30fc\u30bf\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u6700\u521d\u304b\u3089\u5165\u308c\u76f4\u3059\u300d\u5834\u9762\u3067Erase+ReDim\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u4f7f\u308f\u308c\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u300c\u6708\u6b21\u30d0\u30c3\u30c1\u51e6\u7406\u3067\u524d\u6708\u306e\u30c7\u30fc\u30bf\u3092\u6d88\u53bb\u3057\u3066\u304b\u3089\u4eca\u6708\u306e\u30c7\u30fc\u30bf\u3092\u518d\u683c\u7d0d\u3059\u308b\u300d\u51e6\u7406\u3067\u306f\u3001\u53ef\u5909\u9577\u914d\u5217\u306bErase\uff08\u89e3\u653e\uff09\u2192ReDim\uff08\u4eca\u6708\u306e\u4ef6\u6570\u3067\u518d\u78ba\u4fdd\uff09\u2192\u30c7\u30fc\u30bf\u683c\u7d0d\u3001\u3068\u3044\u3046\u6d41\u308c\u306b\u306a\u308a\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u914d\u5217\u306e\u8981\u7d20\u6570\uff08\u4ef6\u6570\uff09\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"UBound(\u914d\u5217\u540d)\u3067\u6700\u5927\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3001LBound(\u914d\u5217\u540d)\u3067\u6700\u5c0f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u8981\u7d20\u6570\u306f\u300cUBound(arr) - LBound(arr) + 1\u300d\u3067\u8a08\u7b97\u3057\u307e\u3059\u30020\u59cb\u307e\u308a\u306a\u3089\u300cUBound(arr) + 1\u300d\u3067\u3082\u540c\u3058\u3067\u3059\u30022\u6b21\u5143\u914d\u5217\u306e\u5834\u5408\u306fUBound(arr, 1)\u3067\u884c\u6570\u3001UBound(arr, 2)\u3067\u5217\u6570\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Dictionary\u3084Collection\u3068\u914d\u5217\u306f\u3069\u3046\u4f7f\u3044\u5206\u3051\u308b\u3079\u304d\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u914d\u5217\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff08\u6570\u5024\uff09\u3067\u30a2\u30af\u30bb\u30b9\u3059\u308b\u9806\u5e8f\u4ed8\u304d\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u3067\u3059\u3002Dictionary\u306f\u30ad\u30fc\uff08\u6587\u5b57\u5217\u306a\u3069\uff09\u3067\u9ad8\u901f\u691c\u7d22\u304c\u3067\u304d\u307e\u3059\u3002\u300c\u9867\u5ba2ID\u3067\u58f2\u4e0a\u3092\u96c6\u8a08\u3059\u308b\u300d\u3088\u3046\u306a\u300c\u30ad\u30fc\u3067\u691c\u7d22\u30fb\u96c6\u7d04\u300d\u304c\u5fc5\u8981\u306a\u51e6\u7406\u306fDictionary\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u65b9\u300cExcel\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u884c\u756a\u53f7\u30fb\u5217\u756a\u53f7\u3067\u305d\u306e\u307e\u307e\u6271\u3046\u300d\u3088\u3046\u306a\u300c\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u30a2\u30af\u30bb\u30b9\u3068\u4e00\u62ec\u5165\u51fa\u529b\u300d\u304c\u4e2d\u5fc3\u306a\u3089\u914d\u5217\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"2\u6b21\u5143\u914d\u5217\u3092\u5168\u4ef6\u30eb\u30fc\u30d7\u3059\u308b\u306b\u306f\u3069\u3046\u66f8\u3051\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"For r = LBound(arr, 1) To UBound(arr, 1): For c = LBound(arr, 2) To UBound(arr, 2): \u51e6\u7406 : Next c: Next r \u3068\u3044\u3046\u4e8c\u91cd\u30eb\u30fc\u30d7\u304c\u57fa\u672c\u3067\u3059\u3002LBound\/UBound\u306b\u7b2c2\u5f15\u6570\uff08\u6b21\u5143\u756a\u53f7\uff09\u3092\u6e21\u3059\u3053\u3068\u3067\u884c\u6570\u30fb\u5217\u6570\u305d\u308c\u305e\u308c\u306e\u4e0a\u9650\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002Range.Value\u3067\u53d6\u5f97\u3057\u305f\u914d\u5217\u306f1\u59cb\u307e\u308a\u306a\u306e\u3067LBound\u306f1\u306b\u306a\u308a\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\uff08\u30b5\u30a4\u30ba\uff09\u306b\u5236\u9650\u306f\u3042\u308a\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"VBA\u306e\u914d\u5217\u306e\u6700\u5927\u8981\u7d20\u6570\u306f\u3001\u5229\u7528\u53ef\u80fd\u306a\u30e1\u30e2\u30ea\u91cf\u306b\u4f9d\u5b58\u3057\u307e\u3059\u3002\u7406\u8ad6\u4e0a\u306f\u6574\u6570\u306e\u6700\u5927\u5024\uff08\u7d0421\u5104\uff09\u307e\u3067\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u5b9f\u969b\u306b\u306f\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u304f\u306a\u308b\u524d\u306b\u300c\u30e1\u30e2\u30ea\u304c\u4e0d\u8db3\u3057\u3066\u3044\u307e\u3059\u300d\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002\u901a\u5e38\u306e\u696d\u52d9\u51e6\u7406\uff08100\u4e07\u884c\u4ee5\u4e0b\uff09\u3067\u3042\u308c\u3070\u5236\u9650\u3092\u610f\u8b58\u3059\u308b\u5fc5\u8981\u306f\u307b\u3068\u3093\u3069\u3042\u308a\u307e\u305b\u3093\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"VBA\u306e\u30b3\u30fc\u30c9\u3092\u30bc\u30ed\u304b\u3089\u66f8\u304f\u306e\u304c\u96e3\u3057\u3044\u306e\u3067\u3059\u304c\u3001AI\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u751f\u6210\u3067\u304d\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u3067\u304d\u307e\u3059\u3002Claude Code\u306b\u300cExcel\u306e\u30c7\u30fc\u30bf\u3092\u914d\u5217\u3067\u51e6\u7406\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u696d\u52d9\u8981\u4ef6\u3092\u65e5\u672c\u8a9e\u3067\u8aac\u660e\u3059\u308b\u3068\u3001\u914d\u5217\u5ba3\u8a00\u30fbReDim\u30fb\u30eb\u30fc\u30d7\u51e6\u7406\u30fb\u4e00\u62ec\u5165\u51fa\u529b\u307e\u3067\u542b\u3093\u3060\u5b8c\u5168\u306aVBA\u30b3\u30fc\u30c9\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u4ef6\u6570\u304c\u5909\u52d5\u3059\u308b\u304b\u56fa\u5b9a\u304b\u3092\u4f1d\u3048\u308b\u3068\u3001\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u306e\u9078\u629e\u3082\u81ea\u52d5\u5224\u65ad\u3055\u308c\u307e\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"<p>VBA\u914d\u5217\u306e\u521d\u671f\u5316\u65b9\u6cd5\uff08Erase\u30fbArray\u30fbReDim\u30fbReDim Preserve\uff09\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u914d\u5217\u306e\u9055\u3044\u304b\u3089\u591a\u6b21\u5143\u914d\u5217\u3001Claude Code\u6d3b\u7528\u307e\u3067\u3001\u696d\u52d9\u3067\u5373\u4f7f\u3048\u308b\u5b9f\u8df5\u30ac\u30a4\u30c9\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":18338,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sitemap_hide":"","_veu_custom_css":"","vkexunit_cta_each_option":"","footnotes":"","rank_math_description":"VBA\u914d\u5217\u306e\u521d\u671f\u5316\u65b9\u6cd5\uff08Erase\u30fbArray\u30fbReDim\u30fbReDim Preserve\uff09\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u56fa\u5b9a\u9577\u30fb\u53ef\u5909\u9577\u914d\u5217\u306e\u9055\u3044\u304b\u3089\u591a\u6b21\u5143\u914d\u5217\u3001Claude Code\u6d3b\u7528\u307e\u3067\u3001\u696d\u52d9\u3067\u5373\u4f7f\u3048\u308b\u5b9f\u8df5\u30ac\u30a4\u30c9\u3067\u3059\u3002","rank_math_focus_keyword":"VBA \u914d\u5217 \u521d\u671f\u5316","rank_math_title":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u914d\u5217\u306e\u521d\u671f\u5316\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cReDim\u30fbPreserve\u30fbArray\u30fbErase\u3092\u696d\u52d9\u3067\u5fb9\u5e95\u89e3\u8aac","pending_rewrite_html":"","pending_rewrite_id":"","pending_rewrite_kw":"","pending_rewrite_at":"","pending_rewrite_source":"","pending_rewrite_brief":"","pending_rewrite_evidence":"","approved_rewrite_html":"","approved_rewrite_id":"","approved_rewrite_kw":"","approved_rewrite_at":"","approved_rewrite_by":"","approved_rewrite_brief":"","approved_rewrite_evidence":"","rewrite_tracker_baseline":"","rewrite_tracker_7day":"","rewrite_tracker_14day":"","rewrite_tracker_30day":"","rewrite_tracker_notified":""},"categories":[3],"tags":[],"class_list":["post-18339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/comments?post=18339"}],"version-history":[{"count":1,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18339\/revisions"}],"predecessor-version":[{"id":18340,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18339\/revisions\/18340"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/18338"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=18339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=18339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=18339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}