{"id":18395,"date":"2026-07-19T03:22:57","date_gmt":"2026-07-18T18:22:57","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=18395"},"modified":"2026-07-19T03:22:57","modified_gmt":"2026-07-18T18:22:57","slug":"cc-vba-while-loop","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-vba-while-loop\/","title":{"rendered":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306eWhile\u30fbDo While\u30eb\u30fc\u30d7\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u4f7f\u3044\u5206\u3051\u3068\u30b3\u30fc\u30c9\u4f8b"},"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-while-loop.jpg\" alt=\"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306eWhile\u30fbDo While\u30eb\u30fc\u30d7\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u4f7f\u3044\u5206\u3051\u3068\u30b3\u30fc\u30c9\u4f8b\" 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\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u5168\u4f53\u50cf<\/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>While Wend\u6587\u306e\u4f7f\u3044\u65b9<\/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>Do While Loop\u6587\u306e\u4f7f\u3044\u65b9<\/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>Do Loop While\u6587\uff08\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\uff09\u306e\u4f7f\u3044\u65b9<\/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>While Wend\u3068Do While\u306e\u9055\u3044\u3068\u4f7f\u3044\u5206\u3051<\/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>\u8907\u6570\u6761\u4ef6\uff08And\/Or\uff09\u306e\u6307\u5b9a\u65b9\u6cd5<\/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>Exit Do\u3067\u9014\u4e2d\u7d42\u4e86\u3059\u308b\u65b9\u6cd5<\/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>\u7121\u9650\u30eb\u30fc\u30d7\u3068\u30c7\u30d0\u30c3\u30b0\u65b9\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>For Next\u3068\u306e\u4f7f\u3044\u5206\u3051\u30ac\u30a4\u30c9<\/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>\u5b9f\u52d9\u3067\u306e\u6d3b\u7528\u30d1\u30bf\u30fc\u30f3\uff08\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u30fbAPI\u30fb\u30b7\u30fc\u30c8\u64cd\u4f5c\uff09<\/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\u3067\u30bb\u30eb\u3092\u4e0a\u304b\u3089\u9806\u306b\u51e6\u7406\u3057\u305f\u3044\u304c\u3001\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u6bce\u56de\u5909\u308f\u308b\u306e\u3067For Next\u3067\u306f\u66f8\u304d\u306b\u304f\u3044\u300d\u300cWhile\u6587\u3068Do While\u6587\u306e\u9055\u3044\u304c\u3088\u304f\u5206\u304b\u3089\u305a\u3001\u3069\u3061\u3089\u3092\u4f7f\u3048\u3070\u3044\u3044\u304b\u8ff7\u3046\u300d\u2014\u2014VBA\u3067\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u66f8\u304d\u59cb\u3081\u308b\u3068\u3001\u6761\u4ef6\u4ed8\u304d\u306e\u7e70\u308a\u8fd4\u3057\u69cb\u6587\u306e\u9078\u629e\u3067\u60a9\u3080\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u306e\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u69cb\u6587\u3067\u3042\u308bWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e3\u7a2e\u985e\u3092\u5b8c\u5168\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u305d\u308c\u305e\u308c\u306e\u69cb\u6587\u306e\u9055\u3044\u30fb\u4f7f\u3044\u5206\u3051\u30fb\u8907\u6570\u6761\u4ef6\u306e\u6307\u5b9a\u30fbExit Do\u306b\u3088\u308b\u9014\u4e2d\u7d42\u4e86\u30fb\u7121\u9650\u30eb\u30fc\u30d7\u306e\u9632\u304e\u65b9\u30fbFor Next\u3068\u306e\u4f7f\u3044\u5206\u3051\u307e\u3067\u3001\u5b9f\u52d9\u3067\u5f79\u7acb\u3064\u30b3\u30fc\u30c9\u4f8b\u3092\u8c4a\u5bcc\u306b\u4ea4\u3048\u3066\u8aac\u660e\u3057\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\">\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306f\u300c\u4ef6\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u300d\u306e\u8981\u3067\u3059\u3002Excel\u30b7\u30fc\u30c8\u306e\u30c7\u30fc\u30bf\u672b\u5c3e\u307e\u3067\u51e6\u7406\u3057\u305f\u3044\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308b\u307e\u3067\u63a2\u3057\u7d9a\u3051\u305f\u3044\u30fb\u30e6\u30fc\u30b6\u30fc\u304c\u6b63\u3057\u3044\u5165\u529b\u3092\u3059\u308b\u307e\u3067\u5165\u529b\u3092\u6c42\u3081\u7d9a\u3051\u305f\u3044\u3068\u3044\u3063\u305f\u51e6\u7406\u306b\u6b20\u304b\u305b\u307e\u305b\u3093\u3002While\u7cfb\u306e\u69cb\u6587\u3092\u304d\u3061\u3093\u3068\u4f7f\u3044\u3053\u306a\u3059\u3060\u3051\u3067\u3001\u696d\u52d9\u30de\u30af\u30ed\u306e\u5e45\u304c\u5927\u304d\u304f\u5e83\u304c\u308a\u307e\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><strong>While Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u9055\u3044<\/strong>\uff1a3\u7a2e\u985e\u306e\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u69cb\u6587\u3092\u6bd4\u8f03<\/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>\u524d\u5224\u5b9a\u3068\u5f8c\u5224\u5b9a\u306e\u9055\u3044<\/strong>\uff1a\u30eb\u30fc\u30d7\u958b\u59cb\u524d\u306b\u6761\u4ef6\u3092\u8a55\u4fa1\u3059\u308b\u304b\u30011\u56de\u5b9f\u884c\u5f8c\u306b\u8a55\u4fa1\u3059\u308b\u304b\u306e\u5dee<\/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>\u8907\u6570\u6761\u4ef6\u306e\u6307\u5b9a\u65b9\u6cd5<\/strong>\uff1aAnd\u3084Or\u3092\u4f7f\u3063\u305f2\u3064\u4ee5\u4e0a\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u66f8\u304d\u65b9<\/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>Exit Do\u306e\u4f7f\u3044\u65b9<\/strong>\uff1a\u30eb\u30fc\u30d7\u306e\u9014\u4e2d\u3067\u51e6\u7406\u3092\u7d42\u4e86\u3055\u305b\u308b\u65b9\u6cd5\u3068\u6ce8\u610f\u70b9<\/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>\u7121\u9650\u30eb\u30fc\u30d7\u306e\u9632\u304e\u65b9<\/strong>\uff1a\u610f\u56f3\u305b\u305a\u6b62\u307e\u3089\u306a\u304f\u306a\u308b\u539f\u56e0\u3068\u5b89\u5168\u306a\u30eb\u30fc\u30d7\u8a2d\u8a08<\/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>For Next\u3068\u306e\u4f7f\u3044\u5206\u3051<\/strong>\uff1a\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u5834\u5408\u30fb\u6c7a\u307e\u3063\u3066\u3044\u306a\u3044\u5834\u5408\u306e\u5224\u65ad\u57fa\u6e96<\/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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">LOOP OVERVIEW<\/span>\n  <span class=\"section-title\" style=\"display:block;\">VBA\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u306e\u5168\u4f53\u50cf<\/span>\n  <span class=\"section-desc\">For Next\u30fbWhile Wend\u30fbDo Loop\u306e3\u7cfb\u7d71\u3068\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306e\u4f4d\u7f6e\u3065\u3051<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u30eb\u30fc\u30d7\u69cb\u6587\u306f\u5927\u304d\u304f\u300c\u56de\u6570\u6307\u5b9a\u30eb\u30fc\u30d7\u300d\u3068\u300c\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u300d\u306e2\u7cfb\u7d71\u306b\u5206\u3051\u3089\u308c\u307e\u3059\u3002\u56de\u6570\u6307\u5b9a\u30eb\u30fc\u30d7\u306fFor Next\u30fbFor Each Next\u304c\u4ee3\u8868\u3067\u3059\u3002\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306fWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u30fbDo Until Loop\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002\u4eca\u56de\u89e3\u8aac\u3059\u308bWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306f\u3059\u3079\u3066\u300c\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u300d\u306e\u4ef2\u9593\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>VBA\u306e\u30eb\u30fc\u30d7\u69cb\u6587<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u56de\u6570\u6307\u5b9a\u30eb\u30fc\u30d7<\/strong><br><span style=\"font-size:12px;\">For Next \/ For Each Next<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7<\/strong><br><span style=\"font-size:12px;\">While Wend \/ Do While \/ Do Loop While<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u51e6\u7406\u4ef6\u6570\u304c\u4e0d\u5b9a\u306a\u5834\u5408\u306b\u4f7f\u7528<\/strong><br><span style=\"font-size:12px;\">\u30c7\u30fc\u30bf\u672b\u5c3e\u30fb\u30d5\u30a1\u30a4\u30eb\u5b58\u5728\u30fb\u5165\u529b\u691c\u8a3c<\/span><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u56de\u6570\u6307\u5b9a\u30eb\u30fc\u30d7\uff08For Next\uff09\u306f\u300c10\u56de\u7e70\u308a\u8fd4\u3059\u300d\u300c\u914d\u5217\u306e\u5168\u8981\u7d20\u3092\u51e6\u7406\u3059\u308b\u300d\u306e\u3088\u3046\u306b\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u3068\u304d\u306b\u4f7f\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u5bfe\u3057\u3066\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306f\u300c\u6761\u4ef6\u304cTrue\u3067\u3042\u308b\u9593\u306f\u7e70\u308a\u8fd4\u3059\u300d\u300c\u30c7\u30fc\u30bf\u304c\u7a7a\u767d\u306b\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\u300d\u306e\u3088\u3046\u306b\u3001\u7d42\u4e86\u30bf\u30a4\u30df\u30f3\u30b0\u304c\u5b9f\u884c\u6642\u306e\u72b6\u6cc1\u306b\u3088\u3063\u3066\u5909\u308f\u308b\u51e6\u7406\u306b\u5411\u3044\u3066\u3044\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>\u6761\u4ef6\u5f0f<\/strong>\uff1a\u30eb\u30fc\u30d7\u306e\u7d99\u7d9a\u30fb\u7d42\u4e86\u3092\u5236\u5fa1\u3059\u308bTrue\u307e\u305f\u306fFalse\u3092\u8fd4\u3059\u5f0f\u3002VBA\u3067\u306fWhile\u6761\u4ef6\u5f0f\u30fbDo While \u6761\u4ef6\u5f0f\u30fbDo Until \u6761\u4ef6\u5f0f\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002\u6bd4\u8f03\u6f14\u7b97\u5b50\uff08=\u30fb<>\u30fb>\u30fb<\u30fb>=\u30fb<=\uff09\u30fb\u8ad6\u7406\u6f14\u7b97\u5b50\uff08And\u30fbOr\u30fbNot\uff09\u30fb\u95a2\u6570\u306e\u623b\u308a\u5024\uff08IsEmpty\u30fbIsNull\u7b49\uff09\u306a\u3069\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u8a18\u8ff0\u3057\u307e\u3059\u3002\u6761\u4ef6\u304cTrue\uff08\u771f\uff09\u306e\u3068\u304d\u300c\u7e70\u308a\u8fd4\u3059\u300d\u304b\u300c\u7d42\u4e86\u3059\u308b\u300d\u304b\u306f\u69cb\u6587\u306b\u3088\u3063\u3066\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u69cb\u6587<\/th><th>\u7a2e\u985e<\/th><th>\u5224\u5b9a\u30bf\u30a4\u30df\u30f3\u30b0<\/th><th>\u7279\u5fb4<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>While Wend<\/td><td>\u524d\u5224\u5b9a\u30eb\u30fc\u30d7<\/td><td>\u30eb\u30fc\u30d7\u5148\u982d\u3067\u8a55\u4fa1<\/td><td>\u53e4\u3044\u69cb\u6587\u30fbExit Wend\u4e0d\u53ef\u30fb\u30b7\u30f3\u30d7\u30eb\u306a\u8a18\u8ff0<\/td><\/tr>\n<tr><td>Do While Loop<\/td><td>\u524d\u5224\u5b9a\u30eb\u30fc\u30d7<\/td><td>\u30eb\u30fc\u30d7\u5148\u982d\u3067\u8a55\u4fa1<\/td><td>\u73fe\u4ee3\u7684\u30fbExit Do\u53ef\u80fd\u30fbUntil\u6761\u4ef6\u306b\u3082\u5909\u63db\u53ef\u80fd<\/td><\/tr>\n<tr><td>Do Loop While<\/td><td>\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7<\/td><td>\u30eb\u30fc\u30d7\u672b\u5c3e\u3067\u8a55\u4fa1<\/td><td>\u5fc5\u305a1\u56de\u4ee5\u4e0a\u5b9f\u884c\u3055\u308c\u308b\u30fbExit Do\u53ef\u80fd<\/td><\/tr>\n<tr><td>Do Until Loop<\/td><td>\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\uff08Until\uff09<\/td><td>\u30eb\u30fc\u30d7\u5148\u982d\u3067\u8a55\u4fa1<\/td><td>\u6761\u4ef6\u304c\u507d\u306e\u9593\u7e70\u308a\u8fd4\u3059\uff08While\u306e\u9006\uff09<\/td><\/tr>\n<tr><td>Do Loop Until<\/td><td>\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\uff08Until\uff09<\/td><td>\u30eb\u30fc\u30d7\u672b\u5c3e\u3067\u8a55\u4fa1<\/td><td>\u5f8c\u5224\u5b9a\u30fb\u6761\u4ef6\u304c\u507d\u306e\u9593\u7e70\u308a\u8fd4\u3059<\/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\">\u300cWhile\u7cfb\u300d\u3068\u300cDo\u7cfb\u300d\u306e\u6700\u5927\u306e\u9055\u3044\u306f\u3001Do\u7cfb\u306b\u306f\u300cExit Do\u300d\u3067\u30eb\u30fc\u30d7\u3092\u9014\u4e2d\u7d42\u4e86\u3067\u304d\u308b\u70b9\u3067\u3059\u3002While Wend\u306b\u306f\u9014\u4e2d\u7d42\u4e86\u306e\u624b\u6bb5\u304c\u306a\u304f\u3001GoTo\u3092\u4f7f\u3046\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002\u3053\u308c\u304c\u73fe\u4ee3VBA\u3067\u306fDo\u7cfb\u304c\u4e3b\u6d41\u306b\u306a\u3063\u3066\u3044\u308b\u5927\u304d\u306a\u7406\u7531\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">WHILE WEND<\/span>\n  <span class=\"section-title\" style=\"display:block;\">While Wend\u6587\u306e\u4f7f\u3044\u65b9<\/span>\n  <span class=\"section-desc\">\u53e4\u304f\u304b\u3089\u3042\u308bVBA\u306e\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u30b7\u30f3\u30d7\u30eb\u306a\u524d\u5224\u5b9a\u30eb\u30fc\u30d7<\/span>\n<\/h2>\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>While Wend\u6587<\/strong>\uff1aVBA\u306e\u6761\u4ef6\u4ed8\u304d\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u300cWhile \u6761\u4ef6\u5f0f \uff5e Wend\u300d\u306e\u5f62\u3067\u8a18\u8ff0\u3057\u3001\u6761\u4ef6\u304cTrue\u3067\u3042\u308b\u9593\u30eb\u30fc\u30d7\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002VB\uff08Visual Basic\uff09\u6642\u4ee3\u304b\u3089\u5b58\u5728\u3059\u308b\u53e4\u3044\u69cb\u6587\u3067\u3001Exit Wend\u306b\u3088\u308b\u9014\u4e2d\u7d42\u4e86\u306f\u3067\u304d\u307e\u305b\u3093\u3002\u73fe\u4ee3VBA\u3067\u306fDo While Loop\u3078\u306e\u79fb\u884c\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u3067\u306f\u4eca\u3067\u3082\u4f7f\u308f\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">While Wend\u6587\u306e\u57fa\u672c\u69cb\u6587\u306f\u300cWhile \u6761\u4ef6\u5f0f\u300d\u300c\uff08\u51e6\u7406\uff09\u300d\u300cWend\u300d\u306e3\u884c\u30bb\u30c3\u30c8\u3067\u3059\u3002\u6761\u4ef6\u5f0f\u304cTrue\u306e\u9593\u3001While\uff5eWend\u306e\u9593\u306e\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002\u6761\u4ef6\u5f0f\u304cFalse\u306b\u306a\u3063\u305f\u6642\u70b9\u3067Wend\u306e\u6b21\u306e\u884c\u306b\u51e6\u7406\u304c\u79fb\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; While Wend\u6587\u306e\u57fa\u672c\u69cb\u6587\nSub WhileWendBasic()\n    Dim i As Integer\n    i = 1\n\n    While i &lt;= 5           &#x27; i \u304c 5 \u4ee5\u4e0b\u306e\u9593\u7e70\u308a\u8fd4\u3059\n        MsgBox &quot;i = &quot; &amp; i\n        i = i + 1          &#x27; \u30ab\u30a6\u30f3\u30bf\u3092\u5fc5\u305a\u66f4\u65b0\u3059\u308b\uff08\u5fd8\u308c\u308b\u3068\u7121\u9650\u30eb\u30fc\u30d7\uff01\uff09\n    Wend\n\n    MsgBox &quot;\u30eb\u30fc\u30d7\u7d42\u4e86\u3002i = &quot; &amp; i  &#x27; i = 6 \u306b\u306a\u3063\u3066\u3044\u308b\nEnd Sub\n\n&#x27; ===\n&#x27; Excel\u30b7\u30fc\u30c8\u306e\u30c7\u30fc\u30bf\u672b\u5c3e\u307e\u3067\u51e6\u7406\u3059\u308bWhile Wend\u306e\u4f8b\nSub WhileWendSheetScan()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;Sheet1&quot;)\n    Dim row As Long\n    row = 2  &#x27; 2\u884c\u76ee\u304b\u3089\u958b\u59cb\uff081\u884c\u76ee\u306f\u30d8\u30c3\u30c0\u30fc\uff09\n\n    &#x27; A\u5217\u304c\u7a7a\u767d\u306b\u306a\u308b\u307e\u3067\u51e6\u7406\u3092\u7e70\u308a\u8fd4\u3059\n    While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot;\n        &#x27; B\u5217\u306e\u5024\u30922\u500d\u306b\u3057\u3066C\u5217\u306b\u8a18\u9332\n        ws.Cells(row, 3).Value = ws.Cells(row, 2).Value * 2\n        row = row + 1      &#x27; \u6b21\u306e\u884c\u3078\n    Wend\n\n    MsgBox &quot;\u51e6\u7406\u5b8c\u4e86\u3002\u6700\u7d42\u884c: &quot; &amp; (row - 1) &amp; &quot;\u884c&quot;\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\">While Wend\u3067\u6700\u3082\u5927\u4e8b\u306a\u306e\u306f\u300c\u6761\u4ef6\u304c\u5fc5\u305aFalse\u306b\u306a\u308b\u3088\u3046\u306b\u30eb\u30fc\u30d7\u5185\u3067\u30ab\u30a6\u30f3\u30bf\u3084\u5909\u6570\u3092\u66f4\u65b0\u3059\u308b\u300d\u3053\u3068\u3067\u3059\u3002i = i + 1\u306e\u3088\u3046\u306a\u66f4\u65b0\u51e6\u7406\u3092\u5fd8\u308c\u308b\u3068\u6761\u4ef6\u304c\u6c38\u9060\u306bTrue\u306e\u307e\u307e\u306b\u306a\u308a\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308a\u307e\u3059\u3002While Wend\u306b\u306f\u9014\u4e2d\u3067\u629c\u3051\u51fa\u3059\u624b\u6bb5\uff08Exit Wend\uff09\u304c\u306a\u3044\u305f\u3081\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u3068\u5f37\u5236\u7d42\u4e86\uff08Ctrl+Break\uff09\u3057\u304b\u5bfe\u51e6\u6cd5\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2-1. While Wend\u3067\u30bb\u30eb\u3092\u8d70\u67fb\u3059\u308b\u5b9f\u52d9\u4f8b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Excel\u306e\u30b7\u30fc\u30c8\u64cd\u4f5c\u3067While Wend\u304c\u6d3b\u8e8d\u3059\u308b\u5178\u578b\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u306f\u300c\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3059\u308b\u884c\u3092\u4e0a\u304b\u3089\u9806\u306b\u51e6\u7406\u3059\u308b\u300d\u3067\u3059\u3002\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u6bce\u56de\u5909\u308f\u308b\u5834\u5408\uff08\u6708\u6b21\u30ec\u30dd\u30fc\u30c8\u306a\u3069\uff09\u3001For Next\u3067\u306f\u6700\u7d42\u884c\u756a\u53f7\u3092\u4e8b\u524d\u306b\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u304c\u3001While Wend\u3067\u306f\u300c\u7a7a\u767d\u306b\u306a\u308b\u307e\u3067\u300d\u3068\u3044\u3046\u6761\u4ef6\u3067\u81ea\u7136\u306b\u66f8\u3051\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; While Wend\u3067\u58f2\u4e0a\u30c7\u30fc\u30bf\u3092\u96c6\u8a08\u3059\u308b\u5b9f\u52d9\u4f8b\nSub SalesAggregationWhileWend()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u58f2\u4e0a\u30c7\u30fc\u30bf&quot;)\n    Dim row As Long\n    row = 2  &#x27; \u30c7\u30fc\u30bf\u958b\u59cb\u884c\n\n    Dim totalSales As Double\n    Dim countRows As Long\n    totalSales = 0\n    countRows = 0\n\n    &#x27; A\u5217\uff08\u65e5\u4ed8\uff09\u304c\u7a7a\u767d\u306b\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\n    While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot;\n        Dim sales As Double\n        sales = CDbl(ws.Cells(row, 3).Value)  &#x27; C\u5217: \u58f2\u4e0a\u91d1\u984d\n\n        &#x27; D\u5217\u306e\u533a\u5206\u304c\u300c\u672c\u793e\u300d\u306e\u884c\u3060\u3051\u96c6\u8a08\n        If ws.Cells(row, 4).Value = &quot;\u672c\u793e&quot; Then\n            totalSales = totalSales + sales\n            countRows = countRows + 1\n        End If\n\n        row = row + 1\n    Wend\n\n    &#x27; \u7d50\u679c\u3092\u8868\u793a\n    MsgBox &quot;\u672c\u793e\u58f2\u4e0a\u5408\u8a08: &quot; &amp; Format(totalSales, &quot;#,##0&quot;) &amp; &quot;\u5186&quot; &amp; vbCrLf &amp; _\n           &quot;\u5bfe\u8c61\u884c\u6570: &quot; &amp; countRows &amp; &quot;\u4ef6&quot;, vbInformation\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;\">While Wend\u306fDo While Loop\u306b\u66f8\u304d\u63db\u3048\u3089\u308c\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">While Wend\u6587\u306f\u3001\u3059\u3079\u3066Do While Loop\u6587\u306b\u66f8\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u300cWhile \u6761\u4ef6\u300d\u3092\u300cDo While \u6761\u4ef6\u300d\u306b\u3001\u300cWend\u300d\u3092\u300cLoop\u300d\u306b\u5909\u3048\u308b\u3060\u3051\u3067\u3059\u3002\u65b0\u898f\u306b\u66f8\u304f\u30b3\u30fc\u30c9\u3067\u306fExit Do\u304c\u4f7f\u3048\u308bDo While Loop\u3092\u63a8\u5968\u3057\u307e\u3059\u304c\u3001\u65e2\u5b58\u306eWhile Wend\u30b3\u30fc\u30c9\u3092\u305d\u306e\u307e\u307e\u4f7f\u3046\u3053\u3068\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">DO WHILE LOOP<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Do While Loop\u6587\u306e\u4f7f\u3044\u65b9<\/span>\n  <span class=\"section-desc\">\u73fe\u4ee3VBA\u306e\u4e3b\u6d41\u30eb\u30fc\u30d7\u69cb\u6587\u3002Exit Do\u306b\u3088\u308b\u9014\u4e2d\u7d42\u4e86\u306b\u5bfe\u5fdc<\/span>\n<\/h2>\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>Do While Loop\u6587<\/strong>\uff1aVBA\u306e\u6761\u4ef6\u4ed8\u304d\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u300cDo While \u6761\u4ef6\u5f0f \uff5e Loop\u300d\u306e\u5f62\u3067\u8a18\u8ff0\u3057\u3001\u6761\u4ef6\u304cTrue\u3067\u3042\u308b\u9593\u30eb\u30fc\u30d7\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\u3002While Wend\u3068\u306e\u6700\u5927\u306e\u9055\u3044\u306fExit Do\u3067\u30eb\u30fc\u30d7\u3092\u9014\u4e2d\u7d42\u4e86\u3067\u304d\u308b\u70b9\u3067\u3059\u3002While Wend\u306eWend\u3092Loop\u306b\u66ff\u3048\u3001While\u3092Do While\u306b\u66ff\u3048\u305f\u5f62\u304c\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u73fe\u4ee3VBA\u3067\u306f\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306e\u30c7\u30d5\u30a1\u30af\u30c8\u30b9\u30bf\u30f3\u30c0\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Do While Loop\u6587\u306e\u57fa\u672c\u69cb\u6587\u306f\u300cDo While \u6761\u4ef6\u5f0f\u300d\u300c\uff08\u51e6\u7406\uff09\u300d\u300cLoop\u300d\u306e3\u884c\u30bb\u30c3\u30c8\u3067\u3059\u3002While Wend\u3068\u540c\u3058\u304f\u300c\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u300d\u3067\u3001\u30eb\u30fc\u30d7\u306b\u5165\u308b\u524d\u306b\u6761\u4ef6\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002\u6761\u4ef6\u304cFalse\u3067\u3042\u308c\u3070\u30eb\u30fc\u30d7\u672c\u4f53\u3092\u4e00\u5ea6\u3082\u5b9f\u884c\u305b\u305a\u306b\u629c\u3051\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; Do While Loop\u306e\u57fa\u672c\u69cb\u6587\nSub DoWhileBasic()\n    Dim counter As Integer\n    counter = 1\n\n    Do While counter &lt;= 10    &#x27; counter \u304c 10 \u4ee5\u4e0b\u306e\u9593\u7e70\u308a\u8fd4\u3059\n        Debug.Print &quot;counter = &quot; &amp; counter\n        counter = counter + 1\n    Loop\n\n    MsgBox &quot;\u5b8c\u4e86\u3002counter = &quot; &amp; counter  &#x27; 11 \u306b\u306a\u3063\u3066\u3044\u308b\nEnd Sub\n\n&#x27; ===\n&#x27; \u521d\u56de\u304b\u3089\u6761\u4ef6\u304cFalse\u306e\u5834\u5408\u306f\u4e00\u5ea6\u3082\u5b9f\u884c\u3055\u308c\u306a\u3044\nSub DoWhileZeroExecution()\n    Dim x As Integer\n    x = 100  &#x27; \u6700\u521d\u304b\u3089\u6761\u4ef6(x &lt;= 5)\u304cFalse\n\n    Do While x &lt;= 5    &#x27; \u3053\u306e\u6761\u4ef6\u306f\u6700\u521d\u304b\u3089False\n        MsgBox &quot;\u5b9f\u884c\u3055\u308c\u308b\uff08\u306f\u305a\u3060\u304c\u5b9f\u969b\u306b\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044\uff09&quot;\n        x = x + 1\n    Loop\n\n    MsgBox &quot;\u30eb\u30fc\u30d7\u672c\u4f53\u306f\u4e00\u5ea6\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002x = &quot; &amp; x  &#x27; x = 100 \u306e\u307e\u307e\nEnd Sub<\/pre>\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\">Do While Loop\u306e\u300c\u524d\u5224\u5b9a\u300d\u3068\u3044\u3046\u7279\u6027\u306f\u91cd\u8981\u3067\u3059\u3002\u30eb\u30fc\u30d7\u306b\u5165\u308b\u524d\u306b\u6761\u4ef6\u3092\u78ba\u8a8d\u3059\u308b\u306e\u3067\u3001\u6700\u521d\u304b\u3089\u6761\u4ef6\u304cFalse\u306a\u30890\u56de\u3057\u304b\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002\u300c\u30c7\u30fc\u30bf\u304c1\u4ef6\u3082\u306a\u3044\u5834\u5408\u306f\u30eb\u30fc\u30d7\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u5834\u5408\u306f\u524d\u5224\u5b9a\u306eDo While Loop\u304c\u9069\u3057\u3066\u3044\u307e\u3059\u3002\u4e00\u65b9\u3067\u300c\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u51e6\u7406\u3092\u5b9f\u884c\u3057\u305f\u3044\u300d\u5834\u5408\u306fDo Loop While\u3092\u4f7f\u3044\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3-1. Do While Loop\u3067\u30bb\u30eb\u3092\u8d70\u67fb\u3059\u308b\u5b9f\u52d9\u4f8b<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Excel\u30b7\u30fc\u30c8\u306eA\u5217\u3092\u4e0a\u304b\u3089\u8d70\u67fb\u3057\u3066\u3001\u30c7\u30fc\u30bf\u304c\u3042\u308b\u884c\u3060\u3051\u3092\u51e6\u7406\u3059\u308b\u5178\u578b\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3092Do While Loop\u3067\u5b9f\u88c5\u3057\u307e\u3059\u3002\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u696d\u52d9\u30de\u30af\u30ed\u3067\u6700\u3082\u3088\u304f\u4f7f\u3046\u30eb\u30fc\u30d7\u5f62\u5f0f\u306e\u4e00\u3064\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; Do While Loop\u3067\u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u8d70\u67fb\u30fb\u6574\u5f62\u3059\u308b\u5b9f\u52d9\u4f8b\nSub SheetScanDoWhile()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u53d7\u6ce8\u30c7\u30fc\u30bf&quot;)\n\n    &#x27; \u6700\u7d42\u884c\u3092\u5148\u306b\u53d6\u5f97\uff08Cells.Find\u65b9\u5f0f\uff09\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim row As Long\n    row = 2  &#x27; 2\u884c\u76ee\u304b\u3089\u30c7\u30fc\u30bf\u958b\u59cb\n\n    Dim processedCount As Long\n    Dim skippedCount As Long\n    processedCount = 0\n    skippedCount = 0\n\n    Do While row &lt;= lastRow    &#x27; \u6700\u7d42\u884c\u306b\u9054\u3059\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\n        Dim cellVal As String\n        cellVal = Trim(ws.Cells(row, 1).Value)  &#x27; A\u5217: \u9867\u5ba2\u540d\n\n        If cellVal = &quot;&quot; Then\n            &#x27; \u7a7a\u767d\u884c\u306f\u30b9\u30ad\u30c3\u30d7\n            skippedCount = skippedCount + 1\n        Else\n            &#x27; B\u5217: \u91d1\u984d\u3092\u6570\u5024\u578b\u306b\u5909\u63db\u3057\u3066C\u5217\u306b\u4e38\u3081\u51e6\u7406\n            Dim amount As Double\n            amount = CDbl(ws.Cells(row, 2).Value)\n            ws.Cells(row, 3).Value = Int(amount \/ 1000) * 1000  &#x27; \u5343\u5186\u5358\u4f4d\u306b\u5207\u308a\u6368\u3066\n\n            &#x27; D\u5217: \u51e6\u7406\u6e08\u307f\u30d5\u30e9\u30b0\u3092\u8a2d\u5b9a\n            ws.Cells(row, 4).Value = &quot;\u51e6\u7406\u6e08&quot;\n            ws.Cells(row, 4).Interior.Color = RGB(198, 239, 206)  &#x27; \u7dd1\u80cc\u666f\n            processedCount = processedCount + 1\n        End If\n\n        row = row + 1  &#x27; \u5fc5\u305a\u6b21\u306e\u884c\u3078\u9032\u3081\u308b\n    Loop\n\n    MsgBox &quot;\u51e6\u7406\u5b8c\u4e86&quot; &amp; vbCrLf &amp; _\n           &quot;\u51e6\u7406\u884c: &quot; &amp; processedCount &amp; &quot;\u4ef6&quot; &amp; vbCrLf &amp; _\n           &quot;\u30b9\u30ad\u30c3\u30d7\uff08\u7a7a\u767d\uff09: &quot; &amp; skippedCount &amp; &quot;\u4ef6&quot;, vbInformation\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;\">lastRow\u53d6\u5f97\u306f Cells.End(xlUp).Row \u304c\u5b9a\u756a<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Do While Loop\u3067\u30b7\u30fc\u30c8\u3092\u8d70\u67fb\u3059\u308b\u3068\u304d\u3001\u300c\u6700\u7d42\u884c\u306f\u3069\u3053\u304b\u300d\u3092\u4e8b\u524d\u306b\u77e5\u3063\u3066\u304a\u304f\u30d1\u30bf\u30fc\u30f3\u304c\u5b89\u5168\u3067\u3059\u3002ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\u306f\u300cA\u5217\u306e\u6700\u5f8c\u306e\u884c\u304b\u3089\u4e0a\u65b9\u5411\u306bCtrl+\u2191\u3057\u305f\u884c\u756a\u53f7\u300d\u3092\u8fd4\u3059\u5b9a\u756a\u306e\u66f8\u304d\u65b9\u3067\u3059\u3002\u3053\u308c\u3092\u4f7f\u3063\u3066Do While row <= lastRow\u3068\u3059\u308c\u3070\u3001\u30c7\u30fc\u30bf\u4ef6\u6570\u306b\u95a2\u4fc2\u306a\u304f\u5b89\u5168\u306b\u8d70\u67fb\u3067\u304d\u307e\u3059\u3002<\/p>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">DO LOOP WHILE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Do Loop While\u6587\uff08\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\uff09\u306e\u4f7f\u3044\u65b9<\/span>\n  <span class=\"section-desc\">\u5fc5\u305a1\u56de\u4ee5\u4e0a\u5b9f\u884c\u3057\u305f\u3044\u3068\u304d\u306b\u4f7f\u3046\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u69cb\u6587<\/span>\n<\/h2>\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>Do Loop While\u6587\uff08\u5f8c\u5224\u5b9a\uff09<\/strong>\uff1aVBA\u306e\u6761\u4ef6\u4ed8\u304d\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u300cDo \uff5e Loop While \u6761\u4ef6\u5f0f\u300d\u306e\u5f62\u3067\u8a18\u8ff0\u3057\u3001\u30eb\u30fc\u30d7\u672b\u5c3e\u3067\u6761\u4ef6\u3092\u8a55\u4fa1\u3057\u307e\u3059\u3002\u300c\u524d\u5224\u5b9a\u300d\u306eDo While Loop\u3068\u7570\u306a\u308a\u3001\u6761\u4ef6\u306e\u8a55\u4fa1\u304c\u30eb\u30fc\u30d7\u672c\u4f53\u306e\u5b9f\u884c\u5f8c\u306b\u884c\u308f\u308c\u308b\u305f\u3081\u3001\u6761\u4ef6\u306b\u95a2\u308f\u3089\u305a\u5fc5\u305a\u6700\u4f4e1\u56de\u306f\u30eb\u30fc\u30d7\u672c\u4f53\u304c\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5165\u529b\u8981\u6c42\u30fb\u521d\u56de\u51e6\u7406\u304c\u5fc5\u9808\u306e\u51e6\u7406\u306a\u3069\u300c\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u5b9f\u884c\u3057\u305f\u3044\u300d\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Do Loop While\u6587\u306f\u300c\u307e\u305a\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u304b\u3089\u6761\u4ef6\u3092\u8a55\u4fa1\u3059\u308b\u300d\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u3067\u3059\u3002\u6761\u4ef6\u5f0f\u306e\u4f4d\u7f6e\u304cLoop\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u5f8c\u308d\u306b\u3042\u308b\u70b9\u304cDo While Loop\u3068\u7570\u306a\u308a\u307e\u3059\u3002\u6700\u521d\u304b\u3089\u6761\u4ef6\u304cFalse\u3067\u3042\u3063\u3066\u3082\u3001\u30eb\u30fc\u30d7\u672c\u4f53\u304c1\u56de\u5b9f\u884c\u3055\u308c\u305f\u5f8c\u306b\u6761\u4ef6\u3092\u78ba\u8a8d\u3057\u3066\u7d42\u4e86\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; Do Loop While\u306e\u57fa\u672c\u69cb\u6587\uff08\u5f8c\u5224\u5b9a\uff1a\u5fc5\u305a1\u56de\u5b9f\u884c\u3055\u308c\u308b\uff09\nSub DoLoopWhileBasic()\n    Dim x As Integer\n    x = 100  &#x27; \u6700\u521d\u304b\u3089\u6761\u4ef6(x &lt;= 5)\u304cFalse\u3060\u304c...\n\n    Do\n        MsgBox &quot;x = &quot; &amp; x &amp; &quot;\uff08\u6761\u4ef6\u304cFalse\u3067\u30821\u56de\u306f\u5b9f\u884c\u3055\u308c\u308b\uff09&quot;\n        x = x + 1\n    Loop While x &lt;= 5    &#x27; \u2190 \u6761\u4ef6\u306e\u8a55\u4fa1\u306f\u3053\u3053\uff08\u30eb\u30fc\u30d7\u672b\u5c3e\uff09\n\n    &#x27; x = 101 \u3067\u7d42\u4e86\uff081\u56de\u3060\u3051\u5b9f\u884c\u3055\u308c\u305f\uff09\n    MsgBox &quot;\u7d42\u4e86\u3002x = &quot; &amp; x\nEnd Sub\n\n&#x27; ===\n&#x27; \u30e6\u30fc\u30b6\u30fc\u306b\u6b63\u3057\u3044\u5165\u529b\u3092\u6c42\u3081\u7d9a\u3051\u308b\uff08\u5165\u529b\u691c\u8a3c\u30eb\u30fc\u30d7\uff09\nSub InputValidationLoop()\n    Dim userInput As String\n\n    Do\n        userInput = InputBox(&quot;1\u301c10\u306e\u6574\u6570\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&quot;)\n\n        &#x27; \u30ad\u30e3\u30f3\u30bb\u30eb\u30dc\u30bf\u30f3\u62bc\u4e0b\u6642\uff08InputBox\u304c\u7a7a\u6587\u5b57\u5217\u3092\u8fd4\u3059\uff09\n        If userInput = &quot;&quot; Then\n            MsgBox &quot;\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u307e\u3057\u305f&quot;, vbInformation\n            Exit Sub\n        End If\n\n        &#x27; \u6570\u5024\u304b\u3064\u7bc4\u56f2\u5185\u304b\u30c1\u30a7\u30c3\u30af\n        If IsNumeric(userInput) Then\n            If CInt(userInput) &gt;= 1 And CInt(userInput) &lt;= 10 Then\n                Exit Do  &#x27; \u6b63\u3057\u3044\u5165\u529b \u2192 \u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b\n            End If\n        End If\n\n        MsgBox &quot;1\u301c10\u306e\u6574\u6570\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbExclamation\n    Loop While True  &#x27; \u2190 Exit Do\u3067\u629c\u3051\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\uff08\u6761\u4ef6\u306f\u5e38\u306bTrue\uff09\n    &#x27; \u203b Loop While True \u3088\u308a Loop While False \u306e\u9006\u3092\u4f7f\u3046\u5834\u5408\u3082\u3042\u308b\n\n    MsgBox &quot;\u5165\u529b\u5024: &quot; &amp; CInt(userInput), vbInformation\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\">Do Loop While\u304c\u771f\u4fa1\u3092\u767a\u63ee\u3059\u308b\u306e\u306f\u300c\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5165\u529b\u8981\u6c42\u300d\u3084\u300c\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u304b\u3089\u6210\u5426\u3092\u78ba\u8a8d\u3059\u308b\u300d\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002InputBox\u3067\u30e6\u30fc\u30b6\u30fc\u306b\u5165\u529b\u3092\u6c42\u3081\u308b\u30eb\u30fc\u30d7\u306f\u3001\u300c\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u5165\u529b\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\u300d\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u5f8c\u5224\u5b9a\u304c\u81ea\u7136\u3067\u3059\u3002Exit Do\u3092\u4f7f\u3063\u3066\u6b63\u3057\u3044\u5165\u529b\u304c\u5f97\u3089\u308c\u305f\u3089\u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b\u8a2d\u8a08\u304c\u304d\u308c\u3044\u306b\u66f8\u3051\u307e\u3059\u3002<\/div>\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;\">\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u3067\u3082\u7121\u9650\u30eb\u30fc\u30d7\u306b\u6ce8\u610f<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Do Loop While\u3082\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u7279\u306b\u300cLoop While True\u300d\u3068\u66f8\u3044\u3066Exit Do\u3067\u3057\u304b\u629c\u3051\u306a\u3044\u30d1\u30bf\u30fc\u30f3\u306f\u3001Exit Do\u306e\u6761\u4ef6\u3092\u8aa4\u3063\u3066\u66f8\u304f\u3068\u6c38\u9060\u306b\u7d42\u308f\u3089\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u3092\u4f7f\u3046\u3068\u304d\u3082\u300cExit Do\u304c\u5fc5\u305a\u5230\u9054\u3067\u304d\u308b\u6761\u4ef6\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u300d\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u3001\u30ab\u30a6\u30f3\u30bf\u3092\u4f7f\u3046\u5834\u5408\u306fDo While Loop\u3068\u540c\u69d8\u306b\u30ab\u30a6\u30f3\u30bf\u306e\u66f4\u65b0\u3092\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">COMPARISON<\/span>\n  <span class=\"section-title\" style=\"display:block;\">While Wend\u3068Do While\u306e\u9055\u3044\u3068\u4f7f\u3044\u5206\u3051<\/span>\n  <span class=\"section-desc\">3\u7a2e\u985e\u306e\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u3092\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u9078\u629e\u3059\u308b\u5224\u65ad\u57fa\u6e96<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">While Wend\u30fbDo While Loop\u30fbDo Loop While\u306e3\u7a2e\u985e\u306f\u3001\u3044\u305a\u308c\u3082\u300c\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u300d\u3067\u3059\u304c\u3001\u4f7f\u3044\u5206\u3051\u306e\u30dd\u30a4\u30f3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002\u5927\u304d\u306a\u5224\u65ad\u8ef8\u306f\u300c\u524d\u5224\u5b9a\u304b\u5f8c\u5224\u5b9a\u304b\u300d\u3068\u300c\u9014\u4e2d\u7d42\u4e86\uff08Exit Do\uff09\u304c\u5fc5\u8981\u304b\u300d\u306e2\u70b9\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u306e\u9078\u629e<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u5fc5\u305a1\u56de\u5b9f\u884c?<\/strong><br><span style=\"font-size:12px;\">Yes\u2192\u5f8c\u5224\u5b9a<br>No\u2192\u524d\u5224\u5b9a<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u9014\u4e2d\u7d42\u4e86\u304c\u5fc5\u8981?<\/strong><br><span style=\"font-size:12px;\">Yes\u2192Do\u7cfb<br>No\u2192\u3069\u3061\u3089\u3067\u3082OK<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u69cb\u6587\u9078\u629e<\/strong><br><span style=\"font-size:12px;\">\u5f8c\u5224\u5b9a: Do Loop While<br>\u524d\u5224\u5b9a+Exit: Do While<br>\u524d\u5224\u5b9a\u30b7\u30f3\u30d7\u30eb: While Wend<\/span><\/div>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u5224\u65ad\u30dd\u30a4\u30f3\u30c8<\/th><th>While Wend<\/th><th>Do While Loop<\/th><th>Do Loop While<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u5224\u5b9a\u30bf\u30a4\u30df\u30f3\u30b0<\/td><td>\u524d\u5224\u5b9a<\/td><td>\u524d\u5224\u5b9a<\/td><td>\u5f8c\u5224\u5b9a<\/td><\/tr>\n<tr><td>\u9014\u4e2d\u7d42\u4e86\uff08Exit\uff09<\/td><td>\u4e0d\u53ef\uff08GoTo\u5fc5\u8981\uff09<\/td><td>Exit Do \u3067\u53ef\u80fd<\/td><td>Exit Do \u3067\u53ef\u80fd<\/td><\/tr>\n<tr><td>0\u56de\u306e\u5b9f\u884c<\/td><td>\u6761\u4ef6\u6b21\u7b2c\u30670\u56de<\/td><td>\u6761\u4ef6\u6b21\u7b2c\u30670\u56de<\/td><td>\u5fc5\u305a1\u56de\u4ee5\u4e0a\u5b9f\u884c<\/td><\/tr>\n<tr><td>Until\u6761\u4ef6\u3078\u306e\u5909\u63db<\/td><td>\u4e0d\u53ef<\/td><td>Do Until Loop\u306b\u5909\u63db\u53ef<\/td><td>Do Loop Until\u306b\u5909\u63db\u53ef<\/td><\/tr>\n<tr><td>\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306e\u63a8\u5968<\/td><td>\u975e\u63a8\u5968\uff08\u30ec\u30ac\u30b7\u30fc\uff09<\/td><td>\u25ce \u63a8\u5968<\/td><td>\u6761\u4ef6\u306b\u5fdc\u3058\u3066\u4f7f\u7528<\/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\">\u5b9f\u52d9\u3067\u306e\u9078\u629e\u6307\u91dd\u306f\u660e\u5feb\u3067\u3059\u3002\u65b0\u898f\u306b\u66f8\u304f\u30b3\u30fc\u30c9\u306fDo While Loop\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u3057\u307e\u3059\u3002\u300c\u5fc5\u305a1\u56de\u306f\u5b9f\u884c\u3057\u305f\u3044\u300d\uff08\u5165\u529b\u691c\u8a3c\u30fb\u521d\u56de\u63a5\u7d9a\u8a66\u884c\u306a\u3069\uff09\u306e\u3068\u304d\u3060\u3051Do Loop While\u3092\u9078\u3073\u307e\u3059\u3002While Wend\u306f\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u8aad\u307f\u53d6\u308a\u306e\u305f\u3081\u306b\u7406\u89e3\u3057\u3066\u304a\u304f\u7a0b\u5ea6\u3067\u3088\u304f\u3001\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306f\u4f7f\u3044\u307e\u305b\u3093\u3002<\/div>\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;\">Do Until Loop\u306fDo While Loop\u306e\u300c\u9006\u6761\u4ef6\u7248\u300d<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Do While Loop\u306e\u300c\u6761\u4ef6\u304cTrue\u306e\u9593\u7e70\u308a\u8fd4\u3059\u300d\u306b\u5bfe\u3057\u3001Do Until Loop\u306f\u300c\u6761\u4ef6\u304cTrue\u306b\u306a\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\uff08\u6761\u4ef6\u304cFalse\u306e\u9593\u7e70\u308a\u8fd4\u3059\uff09\u300d\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u300cDo While ws.Cells(row, 1).Value <> \"\"\u300d\u306f\u300cDo Until ws.Cells(row, 1).Value = \"\"\u300d\u3068\u66f8\u304d\u63db\u3048\u3089\u308c\u307e\u3059\u3002\u3069\u3061\u3089\u304c\u8aad\u307f\u3084\u3059\u3044\u304b\u306f\u72b6\u6cc1\u6b21\u7b2c\u3067\u3059\u304c\u3001\u7d71\u4e00\u611f\u3092\u6301\u305f\u305b\u308b\u305f\u3081\u306b\u30c1\u30fc\u30e0\u5185\u3067\u3069\u3061\u3089\u3092\u4f7f\u3046\u304b\u6c7a\u3081\u3066\u304a\u304f\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\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>For Next\u6587<\/strong>\uff1aVBA\u306e\u56de\u6570\u6307\u5b9a\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u300cFor \u30ab\u30a6\u30f3\u30bf\u5909\u6570 = \u958b\u59cb\u5024 To \u7d42\u4e86\u5024 [Step \u5897\u5206] \uff5e Next \u30ab\u30a6\u30f3\u30bf\u5909\u6570\u300d\u306e\u5f62\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u51e6\u7406\uff08\u914d\u5217\u306e\u5168\u8981\u7d20\u51e6\u7406\u30fb\u56fa\u5b9a\u56de\u6570\u306e\u8a66\u884c\u306a\u3069\uff09\u306b\u5411\u3044\u3066\u3044\u307e\u3059\u3002Do While Loop\u3068\u7570\u306a\u308a\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u56fa\u5b9a\u3055\u308c\u308b\u305f\u3081\u3001\u30eb\u30fc\u30d7\u5909\u6570\u306e\u66f4\u65b0\u3057\u5fd8\u308c\u306b\u3088\u308b\u7121\u9650\u30eb\u30fc\u30d7\u304c\u767a\u751f\u3057\u306a\u3044\u5b89\u5168\u306a\u69cb\u6587\u3067\u3059\u3002<\/p>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">MULTIPLE CONDITIONS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u8907\u6570\u6761\u4ef6\uff08And\/Or\uff09\u306e\u6307\u5b9a\u65b9\u6cd5<\/span>\n  <span class=\"section-desc\">And\u3084Or\u3092\u4f7f\u3063\u3066While\/Do While\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u66f8\u304d\u65b9<\/span>\n<\/h2>\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>\u6761\u4ef6\u5f0f\uff08\u8907\u6570\u6761\u4ef6\uff09<\/strong>\uff1aVBA\u306eWhile\u30fbDo While\u6587\u3067\u306f\u3001And\uff08\u8ad6\u7406\u7a4d\uff1a\u4e21\u65b9\u306e\u6761\u4ef6\u304cTrue\u306e\u3068\u304dTrue\uff09\u30fbOr\uff08\u8ad6\u7406\u548c\uff1a\u3069\u3061\u3089\u304b\u4e00\u65b9\u304cTrue\u306e\u3068\u304dTrue\uff09\u30fbNot\uff08\u5426\u5b9a\uff1aTrue\u3068False\u3092\u53cd\u8ee2\uff09\u3092\u4f7f\u3063\u3066\u8907\u6570\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u3089\u308c\u307e\u3059\u3002\u8907\u6570\u6761\u4ef6\u3092\u66f8\u304f\u3068\u304d\u306f\u62ec\u5f27\u3092\u4f7f\u3063\u3066\u512a\u5148\u9806\u4f4d\u3092\u660e\u793a\u3059\u308b\u3053\u3068\u3067\u3001\u610f\u56f3\u3057\u306a\u3044\u8a55\u4fa1\u9806\u5e8f\u306e\u30d0\u30b0\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">While\u30fbDo While\u6587\u306e\u6761\u4ef6\u5f0f\u306b\u306fAnd\u3084Or\u3092\u4f7f\u3063\u3066\u8907\u6570\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u3089\u308c\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u300cA\u5217\u304c\u7a7a\u767d\u3067\u306a\u3044 \u304b\u3064 B\u5217\u304c0\u3088\u308a\u5927\u304d\u3044\u300d\u3084\u300c\u51e6\u7406\u4ef6\u6570\u304c\u4e0a\u9650\u306b\u9054\u3059\u308b\u304b \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\u300d\u3068\u3044\u3063\u305f\u8907\u5408\u6761\u4ef6\u304c\u66f8\u3051\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; And\uff08\u304b\u3064\uff09\u3067\u8907\u6570\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u4f8b\nSub MultiConditionAnd()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u30c7\u30fc\u30bf&quot;)\n    Dim row As Long\n    row = 2\n    Dim maxRows As Long\n    maxRows = 1000  &#x27; \u5b89\u5168\u4e0a\u9650\uff08\u7121\u9650\u30eb\u30fc\u30d7\u9632\u6b62\uff09\n\n    &#x27; A\u5217\u304c\u7a7a\u767d\u3067\u306a\u3044 AND \u51e6\u7406\u884c\u304c\u4e0a\u9650\u672a\u6e80\u306e\u9593\u7e70\u308a\u8fd4\u3059\n    Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot; And row &lt;= maxRows\n        &#x27; B\u5217\u306e\u6570\u5024\u304c\u6b63\u306e\u5024\u306e\u3068\u304d\u3060\u3051\u51e6\u7406\n        If ws.Cells(row, 2).Value &gt; 0 Then\n            ws.Cells(row, 3).Value = ws.Cells(row, 2).Value * 1.1  &#x27; 10%\u5897\n        End If\n        row = row + 1\n    Loop\n\n    If row &gt; maxRows Then\n        MsgBox &quot;\u4e0a\u9650\u884c\u6570\u306b\u9054\u3057\u307e\u3057\u305f\uff08&quot; &amp; maxRows &amp; &quot;\u884c\uff09\u3002\u51e6\u7406\u3092\u4e2d\u65ad\u3057\u307e\u3057\u305f\u3002&quot;, vbWarning\n    Else\n        MsgBox &quot;\u51e6\u7406\u5b8c\u4e86\u3002\u51e6\u7406\u884c\u6570: &quot; &amp; (row - 2) &amp; &quot;\u4ef6&quot;, vbInformation\n    End If\nEnd Sub\n\n&#x27; ===\n&#x27; Or\uff08\u307e\u305f\u306f\uff09\u3067\u8907\u6570\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u4f8b\nSub MultiConditionOr()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u51e6\u7406\u30ad\u30e5\u30fc&quot;)\n    Dim row As Long\n    row = 2\n    Dim errorOccurred As Boolean\n    errorOccurred = False\n\n    &#x27; \u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u300c\u5f85\u6a5f\u300d\u307e\u305f\u306f\u300c\u518d\u8a66\u884c\u300d\u306e\u30bb\u30eb\u3092\u51e6\u7406\u3059\u308b\n    Do While ws.Cells(row, 1).Value = &quot;\u5f85\u6a5f&quot; Or ws.Cells(row, 1).Value = &quot;\u518d\u8a66\u884c&quot;\n        &#x27; C\u5217\u306e\u51e6\u7406\u3092\u5b9f\u884c\n        On Error Resume Next\n        ws.Cells(row, 4).Value = ws.Cells(row, 2).Value * ws.Cells(row, 3).Value\n        If Err.Number &lt;&gt; 0 Then\n            ws.Cells(row, 1).Value = &quot;\u30a8\u30e9\u30fc&quot;\n            errorOccurred = True\n            Err.Clear\n        Else\n            ws.Cells(row, 1).Value = &quot;\u5b8c\u4e86&quot;\n        End If\n        On Error GoTo 0\n        row = row + 1\n    Loop\n\n    If errorOccurred Then\n        MsgBox &quot;\u4e00\u90e8\u306e\u884c\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;, vbWarning\n    Else\n        MsgBox &quot;\u5168\u884c\u51e6\u7406\u5b8c\u4e86&quot;, vbInformation\n    End If\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\">\u8907\u6570\u6761\u4ef6\u3067\u6700\u3082\u3088\u304f\u4f7f\u3046\u30d1\u30bf\u30fc\u30f3\u304c\u300c\u30c7\u30fc\u30bf\u6761\u4ef6 And \u5b89\u5168\u4e0a\u9650\u300d\u3067\u3059\u3002\u305f\u3068\u3048\u3070Do While row <= lastRow And row <= 10000\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u4ef6\u6570\u30c1\u30a7\u30c3\u30af\u3068\u5b89\u5168\u4e0a\u9650\u3092\u4e21\u65b9\u66f8\u304f\u3053\u3068\u3067\u3001\u4e07\u304c\u4e00lastRow\u306e\u53d6\u5f97\u304c\u8aa4\u3063\u3066\u3044\u3066\u3082\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u3089\u306a\u3044\u5b89\u5168\u8a2d\u8a08\u306b\u306a\u308a\u307e\u3059\u3002\u672c\u756a\u696d\u52d9\u30de\u30af\u30ed\u3067\u306f\u5fc5\u305a\u3053\u306e\u3088\u3046\u306a\u5b89\u5168\u4e0a\u9650\u3092\u5165\u308c\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/div>\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; Not\u3067\u6761\u4ef6\u3092\u53cd\u8ee2\u3055\u305b\u308b\u4f8b\uff08Do Until \u3068\u540c\u7b49\u306e\u66f8\u304d\u65b9\uff09\nSub NotConditionExample()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim row As Long\n    row = 2\n\n    &#x27; \u300cA\u5217\u304c\u7a7a\u767d\u3067\u3042\u308b\u300d\u306e\u5426\u5b9a = \u300cA\u5217\u304c\u7a7a\u767d\u3067\u306a\u3044\u300d\u9593\u7e70\u308a\u8fd4\u3059\n    &#x27; Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot; \u3068\u540c\u7b49\n    Do While Not (ws.Cells(row, 1).Value = &quot;&quot;)\n        Dim name As String\n        name = Trim(ws.Cells(row, 1).Value)\n\n        &#x27; \u7a7a\u767d\u6587\u5b57\u306e\u307f\u306e\u5834\u5408\u3082\u30b9\u30ad\u30c3\u30d7\uff08IsEmpty\u30fbLen\u4e21\u65b9\u78ba\u8a8d\uff09\n        If Len(name) &gt; 0 And Not IsEmpty(ws.Cells(row, 1).Value) Then\n            ws.Cells(row, 2).Value = UCase(Left(name, 1)) &amp; Mid(name, 2)  &#x27; \u5148\u982d\u3092\u5927\u6587\u5b57\u5316\n        End If\n\n        row = row + 1\n    Loop\nEnd Sub<\/pre>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">EXIT DO<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Exit Do\u3067\u9014\u4e2d\u7d42\u4e86\u3059\u308b\u65b9\u6cd5<\/span>\n  <span class=\"section-desc\">\u30eb\u30fc\u30d7\u306e\u9014\u4e2d\u3067\u7279\u5b9a\u6761\u4ef6\u304c\u6e80\u305f\u3055\u308c\u305f\u3089\u5373\u5ea7\u306b\u629c\u3051\u308b\u8a2d\u8a08\u30d1\u30bf\u30fc\u30f3<\/span>\n<\/h2>\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>Exit Do<\/strong>\uff1aDo While Loop\u30fbDo Loop While\u6587\u306e\u4e2d\u3067\u4f7f\u3048\u308b\u30eb\u30fc\u30d7\u9014\u4e2d\u7d42\u4e86\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3002Exit Do\u306b\u9054\u3057\u305f\u6642\u70b9\u3067Loop\u30ad\u30fc\u30ef\u30fc\u30c9\u306e\u6b21\u306e\u884c\u306b\u51e6\u7406\u304c\u79fb\u308a\u307e\u3059\u3002While Wend\u306b\u306f\u5bfe\u5fdc\u3059\u308bExit Wend\u304c\u306a\u3044\u305f\u3081\u3001While Wend\u3092\u30cd\u30b9\u30c8\u3057\u3066\u4f7f\u3046\u5834\u5408\u306e\u30eb\u30fc\u30d7\u9014\u4e2d\u7d42\u4e86\u306fGoTo\u304c\u5fc5\u8981\u3067\u3057\u305f\u3002Exit Do\u306f\u300c\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u300d\u300c\u76ee\u7684\u306e\u30c7\u30fc\u30bf\u304c\u898b\u3064\u304b\u3063\u305f\u3068\u304d\u300d\u300c\u51e6\u7406\u4ef6\u6570\u306e\u4e0a\u9650\u306b\u9054\u3057\u305f\u3068\u304d\u300d\u306a\u3069\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Exit Do\u306f\u300c\u30eb\u30fc\u30d7\u3092\u305d\u306e\u5834\u3067\u7d42\u4e86\u3057\u3066\u3001\u30eb\u30fc\u30d7\u306e\u6b21\u306e\u51e6\u7406\u306b\u9032\u3080\u300d\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002Do While Loop\u30fbDo Loop While\u306e\u4e2d\u3067\u306e\u307f\u4f7f\u3048\u307e\u3059\u3002\u30eb\u30fc\u30d7\u306e\u7d99\u7d9a\u6761\u4ef6\u3068\u306f\u5225\u306b\u300c\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u30eb\u30fc\u30d7\u3092\u5373\u5ea7\u306b\u7d42\u4e86\u3057\u305f\u3044\u300d\u3068\u3044\u3046\u6761\u4ef6\u304c\u3042\u308b\u5834\u5408\u306b\u4f7f\u3044\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; Exit Do\u3067\u7279\u5b9a\u6761\u4ef6\u304c\u6e80\u305f\u3055\u308c\u305f\u3089\u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b\nSub ExitDoSearchExample()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u9867\u5ba2\u4e00\u89a7&quot;)\n    Dim row As Long\n    row = 2\n\n    Dim targetName As String\n    targetName = InputBox(&quot;\u691c\u7d22\u3059\u308b\u9867\u5ba2\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044&quot;)\n\n    Dim foundRow As Long\n    foundRow = 0\n\n    Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot;\n        If ws.Cells(row, 1).Value = targetName Then\n            foundRow = row  &#x27; \u898b\u3064\u304b\u3063\u305f\u884c\u756a\u53f7\u3092\u8a18\u9332\n            Exit Do         &#x27; \u2190 \u3053\u3053\u3067\u5373\u5ea7\u306b\u30eb\u30fc\u30d7\u3092\u629c\u3051\u308b\n        End If\n        row = row + 1\n    Loop\n\n    If foundRow &gt; 0 Then\n        MsgBox targetName &amp; &quot;\u306f&quot; &amp; foundRow &amp; &quot;\u884c\u76ee\u306b\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; _\n               &quot;\u4f1a\u793e\u540d: &quot; &amp; ws.Cells(foundRow, 2).Value, vbInformation\n    Else\n        MsgBox targetName &amp; &quot;\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f&quot;, vbExclamation\n    End If\nEnd Sub\n\n&#x27; ===\n&#x27; \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089Exit Do\u3067\u30eb\u30fc\u30d7\u3092\u4e2d\u65ad\u3059\u308b\u4f8b\nSub ExitDoOnError()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim row As Long\n    row = 2\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim hasError As Boolean\n    hasError = False\n\n    Do While row &lt;= lastRow\n        On Error Resume Next\n        &#x27; \u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u3078\u306e\u30c7\u30fc\u30bf\u66f8\u304d\u8fbc\u307f\uff08\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u308b\u53ef\u80fd\u6027\uff09\n        Dim result As Double\n        result = ws.Cells(row, 2).Value \/ ws.Cells(row, 3).Value\n\n        If Err.Number &lt;&gt; 0 Then\n            &#x27; \u30a8\u30e9\u30fc\u304c\u767a\u751f \u2192 \u30a8\u30e9\u30fc\u60c5\u5831\u3092\u8a18\u9332\u3057\u3066\u30eb\u30fc\u30d7\u3092\u4e2d\u65ad\n            ws.Cells(row, 4).Value = &quot;ERROR: &quot; &amp; Err.Description\n            hasError = True\n            Err.Clear\n            On Error GoTo 0\n            Exit Do    &#x27; \u2190 \u30a8\u30e9\u30fc\u767a\u751f\u6642\u306b\u30eb\u30fc\u30d7\u3092\u5373\u7d42\u4e86\n        End If\n        On Error GoTo 0\n\n        ws.Cells(row, 4).Value = result\n        row = row + 1\n    Loop\n\n    If hasError Then\n        MsgBox row &amp; &quot;\u884c\u76ee\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u305f\u3081\u51e6\u7406\u3092\u4e2d\u65ad\u3057\u307e\u3057\u305f\u3002&quot;, vbCritical\n    Else\n        MsgBox &quot;\u5168\u884c\u51e6\u7406\u5b8c\u4e86\uff08&quot; &amp; lastRow - 1 &amp; &quot;\u4ef6\uff09&quot;, vbInformation\n    End If\nEnd Sub<\/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;\">Exit Do\u306f\u30cd\u30b9\u30c8\u3057\u305fDo Loop\u306e\u6700\u5185\u5074\u306eLoop\u3092\u629c\u3051\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Do Loop\u3092\u30cd\u30b9\u30c8\uff08\u5165\u308c\u5b50\uff09\u3057\u3066\u3044\u308b\u5834\u5408\u3001Exit Do\u306f\u6700\u3082\u5185\u5074\u306eDo Loop\u3060\u3051\u3092\u629c\u3051\u307e\u3059\u3002\u5916\u5074\u306eDo Loop\u306b\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002\u5916\u5074\u306e\u30eb\u30fc\u30d7\u3082\u7d42\u4e86\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u3001\u30d5\u30e9\u30b0\u5909\u6570\uff08Boolean\u578b\uff09\u3092\u4f7f\u3063\u3066\u5916\u5074\u306e\u30eb\u30fc\u30d7\u306e\u6761\u4ef6\u306b\u30d5\u30e9\u30b0\u3092\u7d44\u307f\u8fbc\u3080\u8a2d\u8a08\u304c\u5fc5\u8981\u3067\u3059\u3002\u307e\u305f\u3001For Next\u306e\u30eb\u30fc\u30d7\u304b\u3089\u629c\u3051\u308b\u306b\u306fExit For\u3092\u4f7f\u3044\u307e\u3059\u3002Exit Do\u306fFor Next\u306b\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">INFINITE LOOP<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u7121\u9650\u30eb\u30fc\u30d7\u3068\u30c7\u30d0\u30c3\u30b0\u65b9\u6cd5<\/span>\n  <span class=\"section-desc\">\u610f\u56f3\u305b\u305a\u30de\u30af\u30ed\u304c\u6b62\u307e\u3089\u306a\u304f\u306a\u308b\u539f\u56e0\u3068\u5b89\u5168\u306a\u30eb\u30fc\u30d7\u8a2d\u8a08<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u7121\u9650\u30eb\u30fc\u30d7\u3068\u306f\u3001\u30eb\u30fc\u30d7\u306e\u7d42\u4e86\u6761\u4ef6\u304c\u6e80\u305f\u3055\u308c\u308b\u3053\u3068\u306a\u304f\u6c38\u9060\u306b\u5b9f\u884c\u3057\u7d9a\u3051\u308b\u72b6\u614b\u3067\u3059\u3002While Wend\u30fbDo While Loop\u3067\u6700\u3082\u9665\u308a\u3084\u3059\u3044\u30df\u30b9\u3067\u3059\u3002\u767a\u751f\u3059\u308b\u3068Excel\u304c\u5fdc\u7b54\u306a\u3057\u72b6\u614b\u306b\u306a\u308a\u3001Ctrl+Break\u30ad\u30fc\u3067\u5f37\u5236\u4e2d\u65ad\u3059\u308b\u3057\u304b\u65b9\u6cd5\u304c\u306a\u304f\u306a\u308a\u307e\u3059\uff08\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3067\u7d42\u4e86\u304c\u5fc5\u8981\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; \u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u5178\u578b\u7684\u306a\u30df\u30b9\nSub InfiniteLoopBad()\n    Dim i As Integer\n    i = 1\n\n    &#x27; NG\u4f8b1: \u30ab\u30a6\u30f3\u30bf\u66f4\u65b0\u5fd8\u308c\n    Do While i &lt;= 10\n        Debug.Print i\n        &#x27; i = i + 1 \u3092\u66f8\u304d\u5fd8\u308c\uff01 \u2192 i \u306f\u5e38\u306b 1 \u2192 \u7121\u9650\u30eb\u30fc\u30d7\n    Loop\n\n    &#x27; NG\u4f8b2: \u6761\u4ef6\u304c\u6c38\u9060\u306bTrue\u306b\u306a\u308b\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim row As Long\n    row = 2\n\n    Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot;\n        ws.Cells(row, 2).Value = ws.Cells(row, 1).Value\n        &#x27; row = row + 1 \u3092\u66f8\u304d\u5fd8\u308c\uff01 \u2192 \u5e38\u306b2\u884c\u76ee\u3092\u51e6\u7406 \u2192 \u7121\u9650\u30eb\u30fc\u30d7\n    Loop\nEnd Sub\n\n&#x27; ===\n&#x27; \u5b89\u5168\u306a\u30eb\u30fc\u30d7\u8a2d\u8a08\uff08\u30ab\u30a6\u30f3\u30bf\u4e0a\u9650 + \u66f4\u65b0\u3092\u78ba\u5b9f\u306b\uff09\nSub SafeLoopDesign()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim row As Long\n    row = 2\n    Const MAX_ROWS As Long = 100000  &#x27; \u5b89\u5168\u4e0a\u9650\u306e\u5b9a\u6570\u5316\n\n    Dim loopCount As Long\n    loopCount = 0\n\n    Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot; And loopCount &lt; MAX_ROWS\n        ws.Cells(row, 2).Value = ws.Cells(row, 1).Value * 2\n        row = row + 1         &#x27; \u5fc5\u305a\u30eb\u30fc\u30d7\u306e\u6700\u5f8c\u3067\u66f4\u65b0\n        loopCount = loopCount + 1  &#x27; \u5b89\u5168\u30ab\u30a6\u30f3\u30bf\u3082\u66f4\u65b0\n    Loop\n\n    If loopCount &gt;= MAX_ROWS Then\n        MsgBox &quot;\u5b89\u5168\u4e0a\u9650\uff08&quot; &amp; MAX_ROWS &amp; &quot;\u884c\uff09\u306b\u9054\u3057\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;, vbWarning\n    End If\nEnd Sub<\/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;\">Ctrl+Break\u3067\u5f37\u5236\u505c\u6b62\u3067\u304d\u306a\u3044\u30b1\u30fc\u30b9\u304c\u3042\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Application.EnableCancelKey = xlDisabled\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3068\u3001Ctrl+Break\u306b\u3088\u308b\u5f37\u5236\u505c\u6b62\u304c\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u4e2d\u306b\u3053\u306e\u8a2d\u5b9a\u304c\u6b8b\u3063\u3066\u3044\u308b\u3068\u3001\u7121\u9650\u30eb\u30fc\u30d7\u304b\u3089\u629c\u3051\u51fa\u305b\u306a\u304f\u306a\u308a\u307e\u3059\u3002EnableCancelKey\u3092xlDisabled\u306b\u8a2d\u5b9a\u3059\u308b\u30b3\u30fc\u30c9\u306f\u3001\u5fc5\u305a\u51e6\u7406\u306e\u76f4\u524d\u3060\u3051\u306b\u9650\u5b9a\u3057\u3001\u51e6\u7406\u5f8c\u306bxlInterruptWithMessageOrxlErrorHandler\u306b\u623b\u3059\u304b\u3001On Error\u3067\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3057\u3066\u304f\u3060\u3055\u3044\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\">\u7121\u9650\u30eb\u30fc\u30d7\u304c\u8d77\u304d\u305f\u3068\u304d\u306e\u5bfe\u51e6\u306f\u300cCtrl+Break\uff08\u307e\u305f\u306f\u300cEsc\u300d\u30ad\u30fc\uff09\u3067\u30de\u30af\u30ed\u3092\u5f37\u5236\u505c\u6b62\u300d\u3067\u3059\u3002Excel\u304c\u5b8c\u5168\u306b\u30d5\u30ea\u30fc\u30ba\u3057\u305f\u5834\u5408\u306f\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\uff08Ctrl+Shift+Esc\uff09\u304b\u3089Excel\u30d7\u30ed\u30bb\u30b9\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002\u3053\u306e\u5834\u5408\u306f\u4fdd\u5b58\u3057\u3066\u3044\u306a\u3044\u5909\u66f4\u304c\u5931\u308f\u308c\u308b\u305f\u3081\u3001\u958b\u767a\u4e2d\u306f\u983b\u7e41\u306b\u4fdd\u5b58\u3059\u308b\u7fd2\u6163\u304c\u91cd\u8981\u3067\u3059\u3002<\/div>\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;\">DoEvents\u3067Excel\u306e\u5fdc\u7b54\u3092\u4fdd\u3061\u306a\u304c\u3089\u30eb\u30fc\u30d7\u3092\u5b9f\u884c<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">DoEvents\u95a2\u6570\u3092\u30eb\u30fc\u30d7\u5185\u306b\u5165\u308c\u308b\u3068\u3001Excel\u304c\u4ed6\u306e\u30a4\u30d9\u30f3\u30c8\uff08\u30ad\u30fc\u5165\u529b\u30fb\u30de\u30a6\u30b9\u64cd\u4f5c\u306a\u3069\uff09\u3092\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u300c\u9577\u3044\u30eb\u30fc\u30d7\u306e\u5b9f\u884c\u4e2d\u3067\u3082Ctrl+Break\u3067\u505c\u6b62\u3067\u304d\u308b\u300d\u300c\u753b\u9762\u304c\u66f4\u65b0\u3055\u308c\u308b\u300d\u3068\u3044\u3046\u52b9\u679c\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3060\u3057DoEvents\u306f\u51e6\u7406\u901f\u5ea6\u3092\u843d\u3068\u3059\u526f\u4f5c\u7528\u304c\u3042\u308b\u305f\u3081\u3001\u9577\u5927\u306a\u30eb\u30fc\u30d7\u3084\u8996\u899a\u7684\u306a\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u306e\u307f\u4f7f\u3044\u307e\u3059\u3002<\/p>\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; DoEvents\u3067\u30eb\u30fc\u30d7\u306e\u9014\u4e2d\u3067\u3082\u64cd\u4f5c\u3092\u53d7\u3051\u4ed8\u3051\u308b\u8a2d\u8a08\nSub SafeLoopWithDoEvents()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim row As Long\n    row = 2\n\n    Application.ScreenUpdating = False  &#x27; \u753b\u9762\u66f4\u65b0\u3092\u6b62\u3081\u3066\u9ad8\u901f\u5316\n\n    Do While ws.Cells(row, 1).Value &lt;&gt; &quot;&quot;\n        &#x27; \u91cd\u3044\u51e6\u7406...\n        ws.Cells(row, 2).Value = ws.Cells(row, 1).Value\n\n        &#x27; 100\u884c\u3054\u3068\u306bDoEvents\u3092\u547c\u3073\u51fa\u3057\u3066\u505c\u6b62\u53ef\u80fd\u306b\u3059\u308b\n        If row Mod 100 = 0 Then\n            DoEvents  &#x27; \u2190 \u4ed6\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\uff08Ctrl+Break\u3082\u53d7\u3051\u4ed8\u3051\u308b\uff09\n            Application.StatusBar = row &amp; &quot;\u884c\u76ee\u3092\u51e6\u7406\u4e2d...&quot;  &#x27; \u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u66f4\u65b0\n        End If\n\n        row = row + 1\n    Loop\n\n    Application.ScreenUpdating = True\n    Application.StatusBar = False  &#x27; \u30b9\u30c6\u30fc\u30bf\u30b9\u30d0\u30fc\u3092\u30ea\u30bb\u30c3\u30c8\n    MsgBox &quot;\u51e6\u7406\u5b8c\u4e86\uff08&quot; &amp; (row - 2) &amp; &quot;\u884c\uff09&quot;, vbInformation\nEnd Sub<\/pre>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">FOR NEXT COMPARISON<\/span>\n  <span class=\"section-title\" style=\"display:block;\">For Next\u3068\u306e\u4f7f\u3044\u5206\u3051\u30ac\u30a4\u30c9<\/span>\n  <span class=\"section-desc\">\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u304b\u5426\u304b\u3092\u8ef8\u306b\u3057\u305f\u9078\u629e\u30d5\u30ed\u30fc<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u3092\u66f8\u3044\u3066\u3044\u308b\u3068\u300c\u3053\u306e\u51e6\u7406\u306fFor Next\u3067\u66f8\u304f\u3079\u304d\u304b\u3001Do While Loop\u3067\u66f8\u304f\u3079\u304d\u304b\u300d\u3068\u8ff7\u3046\u5834\u9762\u304c\u3042\u308a\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u5224\u65ad\u57fa\u6e96\u306f\u300c\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u78ba\u5b9a\u3057\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u30eb\u30fc\u30d7\u69cb\u6587\u306e\u9078\u629e<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c<br>\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b?<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Yes \u2192 For Next<\/strong><br><span style=\"font-size:12px;\">\u56fa\u5b9a\u56de\u6570\u30fb\u914d\u5217\u5168\u8981\u7d20<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>No \u2192 Do While Loop<\/strong><br><span style=\"font-size:12px;\">\u30c7\u30fc\u30bf\u672b\u5c3e\u307e\u3067\u30fb\u6761\u4ef6\u5145\u8db3\u307e\u3067<\/span><\/div>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u4f7f\u7528\u5834\u9762<\/th><th>\u63a8\u5968\u69cb\u6587<\/th><th>\u7406\u7531<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u914d\u5217\u306e\u5168\u8981\u7d20\u3092\u51e6\u7406\u3059\u308b<\/td><td>For Next\uff08\u307e\u305f\u306fFor Each\uff09<\/td><td>\u914d\u5217\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u7bc4\u56f2\u304c\u78ba\u5b9a\u3057\u3066\u3044\u308b\u305f\u3081<\/td><\/tr>\n<tr><td>10\u56de\u56fa\u5b9a\u3067\u7e70\u308a\u8fd4\u3059<\/td><td>For Next<\/td><td>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u660e\u78ba\u306a\u305f\u3081For\u304c\u76f4\u611f\u7684<\/td><\/tr>\n<tr><td>\u30b7\u30fc\u30c8\u306e\u30c7\u30fc\u30bf\u672b\u5c3e\u307e\u3067\u51e6\u7406<\/td><td>Do While Loop<\/td><td>\u30c7\u30fc\u30bf\u4ef6\u6570\u304c\u5909\u52d5\u3059\u308b\u305f\u3081\u6761\u4ef6\u4ed8\u304d\u30eb\u30fc\u30d7\u304c\u9069\u5207<\/td><\/tr>\n<tr><td>\u30e6\u30fc\u30b6\u30fc\u304c\u6b63\u3057\u3044\u5165\u529b\u3092\u3059\u308b\u307e\u3067<\/td><td>Do Loop While<\/td><td>\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u5165\u529b\u3092\u6c42\u3081\u308b\u5f8c\u5224\u5b9a\u304c\u81ea\u7136<\/td><\/tr>\n<tr><td>\u7279\u5b9a\u306e\u5024\u3092\u898b\u3064\u3051\u308b\u307e\u3067\u691c\u7d22<\/td><td>Do While Loop + Exit Do<\/td><td>Exit Do\u3067\u767a\u898b\u6642\u306b\u5373\u5ea7\u306b\u629c\u3051\u3089\u308c\u308b\u305f\u3081<\/td><\/tr>\n<tr><td>\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u307e\u3067\u5f85\u6a5f<\/td><td>Do While Loop<\/td><td>\u30d5\u30a1\u30a4\u30eb\u5b58\u5728\u78ba\u8a8d\u306f\u6761\u4ef6\u5f0f\u3068\u3057\u3066\u8868\u73fe\u3057\u3084\u3059\u3044<\/td><\/tr>\n<tr><td>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5168\u8981\u7d20\u3092\u51e6\u7406<\/td><td>For Each Next<\/td><td>\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5c02\u7528\u306e\u69cb\u6587\u304c\u6700\u3082\u30b7\u30f3\u30d7\u30eb<\/td><\/tr>\n<\/tbody>\n<\/table>\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\">\u8ff7\u3063\u305f\u3089Do While Loop\u3092\u9078\u3076\u306e\u304c\u73fe\u4ee3VBA\u306e\u6307\u91dd\u3067\u3059\u3002For Next\u306b\u66f8\u3051\u308b\u3082\u306e\u3092\u3042\u3048\u3066Do While Loop\u3067\u66f8\u3044\u3066\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u9006\uff08Do While Loop\u3067\u66f8\u3051\u308b\u3082\u306e\u3092For Next\u3067\u7121\u7406\u3084\u308a\u66f8\u304f\uff09\u306f\u8907\u96d1\u306b\u306a\u308a\u304c\u3061\u3067\u3059\u3002\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u3067\u300c\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u6c7a\u307e\u3063\u3066\u3044\u308b\u306e\u306bDo While\uff1f\u300d\u3068\u6307\u6458\u3055\u308c\u305f\u3089For Next\u3078\u306e\u66f8\u304d\u63db\u3048\u3092\u691c\u8a0e\u3057\u307e\u3059\u3002<\/div>\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>For Each Next\u6587<\/strong>\uff1aVBA\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff08Worksheets\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3084Range\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306a\u3069\uff09\u306e\u5168\u8981\u7d20\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30d7\u69cb\u6587\u3002\u300cFor Each \u8981\u7d20\u5909\u6570 In \u30b3\u30ec\u30af\u30b7\u30e7\u30f3 \uff5e Next \u8981\u7d20\u5909\u6570\u300d\u306e\u5f62\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4ef6\u6570\u3092\u4e8b\u524d\u306b\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u76f4\u611f\u7684\u306b\u66f8\u3051\u307e\u3059\u3002\u30b7\u30fc\u30c8\u3092\u5168\u90e8\u51e6\u7406\u3057\u305f\u3044\u30fb\u30bb\u30eb\u306e\u7bc4\u56f2\u3092\u5168\u90e8\u30b9\u30ad\u30e3\u30f3\u3057\u305f\u3044\u3068\u3044\u3063\u305f\u5834\u9762\u3067\u6700\u3082\u30b7\u30f3\u30d7\u30eb\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\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; For Next\u3068Do While Loop\u306e\u4f7f\u3044\u5206\u3051\u6bd4\u8f03\nSub ForVsDoWhileComparison()\n\n    &#x27; ===== \u7e70\u308a\u8fd4\u3057\u56de\u6570\u56fa\u5b9a \u2192 For Next\u304c\u9069\u5207 =====\n    &#x27; 5\u56de\u7e70\u308a\u8fd4\u3057\u3066A1:A5\u306b\u30b7\u30ea\u30a2\u30eb\u756a\u53f7\u3092\u5165\u308c\u308b\n    Dim i As Integer\n    For i = 1 To 5\n        Cells(i, 1).Value = i\n    Next i\n\n    &#x27; ===== \u4ef6\u6570\u4e0d\u5b9a\u306e\u30c7\u30fc\u30bf\u51e6\u7406 \u2192 Do While Loop\u304c\u9069\u5207 =====\n    &#x27; B\u5217\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308b\u884c\u3092\u5168\u51e6\u7406\uff08\u4ef6\u6570\u306f\u6bce\u56de\u5909\u308f\u308b\uff09\n    Dim row As Long\n    row = 1\n    Do While Cells(row, 2).Value &lt;&gt; &quot;&quot;\n        Cells(row, 3).Value = Cells(row, 2).Value * 2\n        row = row + 1\n    Loop\n\n    &#x27; ===== \u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5168\u8981\u7d20 \u2192 For Each Next\u304c\u6700\u3082\u30b7\u30f3\u30d7\u30eb =====\n    &#x27; \u5168\u30b7\u30fc\u30c8\u306b\u51e6\u7406\u65e5\u3092\u8a18\u9332\n    Dim ws As Worksheet\n    For Each ws In ThisWorkbook.Sheets\n        ws.Cells(1, 10).Value = &quot;\u66f4\u65b0\u65e5: &quot; &amp; Format(Now(), &quot;yyyy\/mm\/dd&quot;)\n    Next ws\n\n    MsgBox &quot;\u5168\u51e6\u7406\u5b8c\u4e86&quot;, vbInformation\nEnd Sub<\/pre>\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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;\">PRACTICAL PATTERNS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u5b9f\u52d9\u3067\u306e\u6d3b\u7528\u30d1\u30bf\u30fc\u30f3\uff08\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u30fbAPI\u30fb\u30b7\u30fc\u30c8\u64cd\u4f5c\uff09<\/span>\n  <span class=\"section-desc\">Do While Loop\u3092\u4f7f\u3063\u305f\u696d\u52d9\u30de\u30af\u30ed\u306e\u5b9f\u8df5\u30b3\u30fc\u30c9\u4f8b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3053\u3067\u306f\u5b9f\u52d9\u3067\u3088\u304f\u767b\u5834\u3059\u308bDo While Loop\u306e\u6d3b\u7528\u30d1\u30bf\u30fc\u30f3\u30923\u3064\u7d39\u4ecb\u3057\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u30fb\u8907\u6570\u30b7\u30fc\u30c8\u306e\u96c6\u8a08\u30fb\u7e70\u308a\u8fd4\u3057\u691c\u7d22\u306e3\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">10-1. \u8907\u6570\u306eExcel\u30d5\u30a1\u30a4\u30eb\u3092\u9806\u756a\u306b\u51e6\u7406\u3059\u308b\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; \u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u3059\u3079\u3066\u306eExcel\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u30d1\u30bf\u30fc\u30f3\nSub ProcessAllExcelFiles()\n    Dim folderPath As String\n    folderPath = &quot;C:\\Users\\kohei\\Documents\\\u6708\u6b21\u30c7\u30fc\u30bf\\&quot;  &#x27; \u51e6\u7406\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\n\n    &#x27; \u30d5\u30a9\u30eb\u30c0\u5185\u306e\u6700\u521d\u306exlsx\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\n    Dim fileName As String\n    fileName = Dir(folderPath &amp; &quot;*.xlsx&quot;)\n\n    &#x27; \u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u304f\u306a\u308b\u307e\u3067\u30eb\u30fc\u30d7\uff08Do While + Dir\uff09\n    Dim processedCount As Long\n    processedCount = 0\n\n    Do While fileName &lt;&gt; &quot;&quot;  &#x27; \u2190 Dir\u304c\u7a7a\u6587\u5b57\u3092\u8fd4\u3057\u305f\u3089\u7d42\u4e86\n        Dim fullPath As String\n        fullPath = folderPath &amp; fileName\n\n        &#x27; \u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u51e6\u7406\n        Dim wb As Workbook\n        On Error Resume Next\n        Set wb = Workbooks.Open(fullPath, ReadOnly:=True)\n        On Error GoTo 0\n\n        If Not wb Is Nothing Then\n            &#x27; 1\u30b7\u30fc\u30c8\u76ee\u306eA1\u306e\u5024\u3092\u53d6\u5f97\u3057\u3066\u30a4\u30df\u30c7\u30a3\u30a8\u30a4\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u51fa\u529b\n            Debug.Print fileName &amp; &quot; -&gt; A1 = &quot; &amp; wb.Sheets(1).Cells(1, 1).Value\n            wb.Close False\n            processedCount = processedCount + 1\n        End If\n\n        &#x27; \u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\n        fileName = Dir()  &#x27; \u2190 Dir()\u3092\u5f15\u6570\u306a\u3057\u3067\u547c\u3076\u3068\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u8fd4\u3059\n    Loop\n\n    MsgBox processedCount &amp; &quot;\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3057\u307e\u3057\u305f&quot;, vbInformation\nEnd Sub<\/pre>\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\">Dir()\u95a2\u6570\u3068\u7d44\u307f\u5408\u308f\u305b\u305fDo While Loop\u306f\u300c\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u5168\u30d5\u30a1\u30a4\u30eb\u3092\u51e6\u7406\u3059\u308b\u300d\u5b9a\u756a\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u6700\u521d\u306bDir(\u30d1\u30b9 & \"*.xlsx\")\u3067\u30d5\u30a1\u30a4\u30eb\u4e00\u89a7\u306e\u6700\u521d\u306e\u8981\u7d20\u3092\u53d6\u5f97\u3057\u3001\u30eb\u30fc\u30d7\u306e\u6700\u5f8c\u3067Dir()\uff08\u5f15\u6570\u306a\u3057\uff09\u3092\u547c\u3076\u3053\u3068\u3067\u6b21\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u9806\u306b\u53d6\u5f97\u3057\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u304c\u306a\u304f\u306a\u308b\u3068\u7a7a\u6587\u5b57\u3092\u8fd4\u3059\u306e\u3067\u3001\u305d\u308c\u304c\u30eb\u30fc\u30d7\u7d42\u4e86\u6761\u4ef6\u306b\u306a\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10-2. \u30b7\u30fc\u30c8\u30c7\u30fc\u30bf\u306e\u91cd\u8907\u30c1\u30a7\u30c3\u30af\u30fb\u6574\u5f62\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; Do While Loop\u3067\u91cd\u8907\u884c\u3092\u691c\u51fa\u30fb\u30de\u30fc\u30af\u3059\u308b\u30d1\u30bf\u30fc\u30f3\nSub FindDuplicateRows()\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u58f2\u4e0a\u660e\u7d30&quot;)\n\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    &#x27; \u5916\u5074\u30eb\u30fc\u30d7: \u6bd4\u8f03\u5143\u306e\u884c\n    Dim baseRow As Long\n    baseRow = 2\n\n    Do While baseRow &lt; lastRow\n        Dim compareRow As Long\n        compareRow = baseRow + 1\n\n        &#x27; \u5185\u5074\u30eb\u30fc\u30d7: \u6bd4\u8f03\u5148\u306e\u884c\uff08Do While Loop\u306e\u30cd\u30b9\u30c8\uff09\n        Do While compareRow &lt;= lastRow\n            &#x27; A\u5217\uff08\u9867\u5ba2\u30b3\u30fc\u30c9\uff09\u3068B\u5217\uff08\u65e5\u4ed8\uff09\u304c\u4e00\u81f4\u3057\u305f\u3089\u91cd\u8907\n            If ws.Cells(baseRow, 1).Value = ws.Cells(compareRow, 1).Value And _\n               ws.Cells(baseRow, 2).Value = ws.Cells(compareRow, 2).Value Then\n                &#x27; \u91cd\u8907\u884c\u3092E\u5217\u306b\u8a18\u9332\u3057\u3001\u80cc\u666f\u3092\u9ec4\u8272\u306b\u3059\u308b\n                ws.Cells(compareRow, 5).Value = &quot;\u91cd\u8907\uff08&quot; &amp; baseRow &amp; &quot;\u884c\u76ee\u3068\uff09&quot;\n                ws.Cells(compareRow, 5).Interior.Color = RGB(255, 255, 0)\n            End If\n            compareRow = compareRow + 1\n        Loop\n\n        baseRow = baseRow + 1\n    Loop\n\n    MsgBox &quot;\u91cd\u8907\u30c1\u30a7\u30c3\u30af\u5b8c\u4e86\u3002\u9ec4\u8272\u306e\u884c\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;, vbInformation\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10-3. \u5916\u90e8API\u3078\u306e\u30ea\u30c8\u30e9\u30a4\u4ed8\u304d\u30a2\u30af\u30bb\u30b9\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; Do Loop While\u3067\u30ea\u30c8\u30e9\u30a4\u4ed8\u304dAPI\u547c\u3073\u51fa\u3057\nSub ApiCallWithRetry()\n    &#x27; \u203b Microsoft XML v6.0\u53c2\u7167\u8a2d\u5b9a\u304c\u5fc5\u8981\n    Dim apiUrl As String\n    apiUrl = &quot;https:\/\/api.example.com\/data&quot;\n\n    Dim maxRetry As Integer\n    Dim retryCount As Integer\n    Dim isSuccess As Boolean\n    maxRetry = 3\n    retryCount = 0\n    isSuccess = False\n\n    Dim xmlHttp As Object\n    Set xmlHttp = CreateObject(&quot;MSXML2.XMLHTTP&quot;)\n\n    &#x27; \u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7: \u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u8a66\u884c\u3059\u308b\n    Do\n        On Error Resume Next\n        xmlHttp.Open &quot;GET&quot;, apiUrl, False\n        xmlHttp.send\n\n        If Err.Number = 0 And xmlHttp.Status = 200 Then\n            &#x27; \u6210\u529f\n            isSuccess = True\n            Err.Clear\n        Else\n            &#x27; \u5931\u6557\n            retryCount = retryCount + 1\n            Err.Clear\n            If retryCount &lt; maxRetry Then\n                Application.Wait Now + TimeValue(&quot;00:00:02&quot;)  &#x27; 2\u79d2\u5f85\u6a5f\u3057\u3066\u30ea\u30c8\u30e9\u30a4\n                MsgBox &quot;API\u30a2\u30af\u30bb\u30b9\u5931\u6557\u3002\u30ea\u30c8\u30e9\u30a4 &quot; &amp; retryCount &amp; &quot;\/&quot; &amp; maxRetry, vbInformation\n            End If\n        End If\n        On Error GoTo 0\n\n    Loop While Not isSuccess And retryCount &lt; maxRetry  &#x27; \u6210\u529f or \u4e0a\u9650\u56de\u6570\u306b\u9054\u3057\u305f\u3089\u7d42\u4e86\n\n    If isSuccess Then\n        &#x27; \u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u51e6\u7406\n        Dim responseText As String\n        responseText = xmlHttp.responseText\n        MsgBox &quot;API\u547c\u3073\u51fa\u3057\u6210\u529f\uff08&quot; &amp; retryCount + 1 &amp; &quot;\u56de\u76ee\uff09&quot;, vbInformation\n        &#x27; ... \u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u30d1\u30fc\u30b9\u3057\u3066\u51e6\u7406 ...\n    Else\n        MsgBox &quot;API\u547c\u3073\u51fa\u3057\u304c&quot; &amp; maxRetry &amp; &quot;\u56de\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002&quot;, vbCritical\n    End If\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\">\u30ea\u30c8\u30e9\u30a4\u4ed8\u304dAPI\u547c\u3073\u51fa\u3057\u306fDo Loop While\uff08\u5f8c\u5224\u5b9a\uff09\u304c\u81ea\u7136\u306b\u66f8\u3051\u308b\u30d1\u30bf\u30fc\u30f3\u306e\u597d\u4f8b\u3067\u3059\u3002\u300c\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u8a66\u884c\u3059\u308b\u300d\u300c\u6210\u529f\u3059\u308b\u304b\u30ea\u30c8\u30e9\u30a4\u4e0a\u9650\u306b\u9054\u3059\u308b\u307e\u3067\u7e70\u308a\u8fd4\u3059\u300d\u3068\u3044\u3046\u8981\u4ef6\u304c\u5f8c\u5224\u5b9a\u30eb\u30fc\u30d7\u306b\u3074\u3063\u305f\u308a\u5f53\u3066\u306f\u307e\u308a\u307e\u3059\u3002isSuccess\u30d5\u30e9\u30b0\u3068retryCount\u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u30eb\u30fc\u30d7\u7d42\u4e86\u6761\u4ef6\u3092\u660e\u78ba\u306b\u5236\u5fa1\u3067\u304d\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-while-loop&#038;blog_slug=cc-vba-while-loop\" 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-while-loop&#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<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. While Wend\u3068Do While Loop\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u4e21\u65b9\u3068\u3082\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u3067\u3001\u57fa\u672c\u7684\u306a\u52d5\u4f5c\u306f\u540c\u3058\u3067\u3059\u3002\u6700\u5927\u306e\u9055\u3044\u306fExit Do\uff08\u9014\u4e2d\u7d42\u4e86\uff09\u306e\u53ef\u5426\u3067\u3059\u3002While Wend\u306b\u306f\u9014\u4e2d\u7d42\u4e86\u306e\u69cb\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001Do While Loop\u306fExit Do\u3067\u3044\u3064\u3067\u3082\u30eb\u30fc\u30d7\u3092\u629c\u3051\u3089\u308c\u307e\u3059\u3002\u307e\u305f\u3001Do\u7cfb\u306fUntil\u6761\u4ef6\uff08\u6761\u4ef6\u304cFalse\u306e\u9593\u7e70\u308a\u8fd4\u3059\uff09\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306fDo While Loop\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Do While Loop\u3068Do Loop While\u306e\u4f7f\u3044\u5206\u3051\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u300c\u6700\u521d\u304b\u3089\u6761\u4ef6\u304cFalse\u306e\u5834\u5408\u306b\u30eb\u30fc\u30d7\u672c\u4f53\u3092\u5b9f\u884c\u3057\u305f\u3044\u304b\u5426\u304b\u300d\u304c\u5224\u65ad\u57fa\u6e96\u3067\u3059\u3002Do While Loop\uff08\u524d\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u304cFalse\u306a\u30890\u56de\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002Do Loop While\uff08\u5f8c\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u306b\u95a2\u308f\u3089\u305a\u5fc5\u305a1\u56de\u306f\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5165\u529b\u8981\u6c42\uff08\u6700\u4f4e1\u56de\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\uff09\u3084\u30ea\u30c8\u30e9\u30a4\u51e6\u7406\uff08\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u8a66\u307f\u308b\uff09\u306b\u306fDo Loop While\u304c\u81ea\u7136\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Exit Do\u3068Exit For\u306fDo\u30eb\u30fc\u30d7\u4ee5\u5916\u306b\u3082\u4f7f\u3048\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u3044\u3044\u3048\u3002Exit Do\u306fDo\u7cfb\u30eb\u30fc\u30d7\uff08Do While Loop\u30fbDo Loop While\u30fbDo Until\u7b49\uff09\u5c02\u7528\u3067\u3059\u3002For Next\u3092\u629c\u3051\u308b\u306b\u306fExit For\u3092\u4f7f\u3044\u307e\u3059\u3002While Wend\u306b\u306f\u5bfe\u5fdc\u3059\u308bExit Wend\u304c\u3042\u308a\u307e\u305b\u3093\u3002While Wend\u3092\u9014\u4e2d\u7d42\u4e86\u3055\u305b\u308b\u306b\u306f\u3001GoTo\u3067Wend\u306e\u6b21\u306e\u30e9\u30d9\u30eb\u306b\u98db\u3076\u65b9\u6cd5\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u304cWhile Wend\u3088\u308aDo WhileLoop\u3092\u63a8\u5968\u3059\u308b\u7406\u7531\u306e\u4e00\u3064\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u3063\u305f\u3068\u304d\u306e\u6b62\u3081\u65b9\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. Ctrl+Break\uff08Break\u30ad\u30fc\u304c\u306a\u3044\u5834\u5408\u306fCtrl+Pause\uff09\u3067VBA\u30de\u30af\u30ed\u3092\u5f37\u5236\u505c\u6b62\u3067\u304d\u307e\u3059\u3002VBE\u306e\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u3042\u308b\u300c\u30ea\u30bb\u30c3\u30c8\u300d\u30dc\u30bf\u30f3\uff08\u25a0\uff09\u3067\u3082\u505c\u6b62\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u3067\u6b62\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\uff08Ctrl+Shift+Esc\uff09\u304b\u3089Microsoft Excel\u3092\u5f37\u5236\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305f\u3060\u3057\u3053\u306e\u5834\u5408\u3001\u672a\u4fdd\u5b58\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002Application.EnableCancelKey = xlDisabled\u306e\u8a2d\u5b9a\u304c\u3042\u308b\u5834\u5408\u306fCtrl+Break\u304c\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u4e8b\u524d\u306b\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. For Next\u306e\u4ee3\u308f\u308a\u306bDo While Loop\u3067\u66f8\u3044\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u306f\u3044\u3001\u52d5\u4f5c\u4e0a\u306f\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u300c\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u51e6\u7406\u300d\u306fFor Next\u306e\u65b9\u304c\u610f\u56f3\u304c\u660e\u78ba\u306b\u4f1d\u308f\u308a\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u30fb\u4fdd\u5b88\u6027\u3092\u8003\u3048\u308b\u3068\u3001\u56fa\u5b9a\u56de\u6570\u3084\u914d\u5217\u306e\u5168\u8981\u7d20\u51e6\u7406\u306b\u306fFor Next\u30fb\u914d\u5217\u3084\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5168\u4f53\u306b\u306fFor Each\u30fb\u4ef6\u6570\u4e0d\u5b9a\u306e\u6761\u4ef6\u4ed8\u304d\u7e70\u308a\u8fd4\u3057\u306b\u306fDo While Loop\u3068\u4f7f\u3044\u5206\u3051\u308b\u306e\u304cVBA\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\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\": \"While Wend\u3068Do While Loop\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u4e21\u65b9\u3068\u3082\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u3067\u3001\u57fa\u672c\u7684\u306a\u52d5\u4f5c\u306f\u540c\u3058\u3067\u3059\u3002\u6700\u5927\u306e\u9055\u3044\u306fExit Do\uff08\u9014\u4e2d\u7d42\u4e86\uff09\u306e\u53ef\u5426\u3067\u3059\u3002While Wend\u306b\u306f\u9014\u4e2d\u7d42\u4e86\u306e\u69cb\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001Do While Loop\u306fExit Do\u3067\u3044\u3064\u3067\u3082\u30eb\u30fc\u30d7\u3092\u629c\u3051\u3089\u308c\u307e\u3059\u3002\u307e\u305f\u3001Do\u7cfb\u306fUntil\u6761\u4ef6\uff08\u6761\u4ef6\u304cFalse\u306e\u9593\u7e70\u308a\u8fd4\u3059\uff09\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306fDo While Loop\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Do While Loop\u3068Do Loop While\u306e\u4f7f\u3044\u5206\u3051\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u300c\u6700\u521d\u304b\u3089\u6761\u4ef6\u304cFalse\u306e\u5834\u5408\u306b\u30eb\u30fc\u30d7\u672c\u4f53\u3092\u5b9f\u884c\u3057\u305f\u3044\u304b\u5426\u304b\u300d\u304c\u5224\u65ad\u57fa\u6e96\u3067\u3059\u3002Do While Loop\uff08\u524d\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u304cFalse\u306a\u30890\u56de\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002Do Loop While\uff08\u5f8c\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u306b\u95a2\u308f\u3089\u305a\u5fc5\u305a1\u56de\u306f\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5165\u529b\u8981\u6c42\uff08\u6700\u4f4e1\u56de\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\uff09\u3084\u30ea\u30c8\u30e9\u30a4\u51e6\u7406\uff08\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u8a66\u307f\u308b\uff09\u306b\u306fDo Loop While\u304c\u81ea\u7136\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Exit Do\u3068Exit For\u306fDo\u30eb\u30fc\u30d7\u4ee5\u5916\u306b\u3082\u4f7f\u3048\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u3044\u3044\u3048\u3002Exit Do\u306fDo\u7cfb\u30eb\u30fc\u30d7\uff08Do While Loop\u30fbDo Loop While\u30fbDo Until\u7b49\uff09\u5c02\u7528\u3067\u3059\u3002For Next\u3092\u629c\u3051\u308b\u306b\u306fExit For\u3092\u4f7f\u3044\u307e\u3059\u3002While Wend\u306b\u306f\u5bfe\u5fdc\u3059\u308bExit Wend\u304c\u3042\u308a\u307e\u305b\u3093\u3002While Wend\u3092\u9014\u4e2d\u7d42\u4e86\u3055\u305b\u308b\u306b\u306f\u3001GoTo\u3067Wend\u306e\u6b21\u306e\u30e9\u30d9\u30eb\u306b\u98db\u3076\u65b9\u6cd5\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u304cWhile Wend\u3088\u308aDo WhileLoop\u3092\u63a8\u5968\u3059\u308b\u7406\u7531\u306e\u4e00\u3064\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u3063\u305f\u3068\u304d\u306e\u6b62\u3081\u65b9\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Ctrl+Break\uff08Break\u30ad\u30fc\u304c\u306a\u3044\u5834\u5408\u306fCtrl+Pause\uff09\u3067VBA\u30de\u30af\u30ed\u3092\u5f37\u5236\u505c\u6b62\u3067\u304d\u307e\u3059\u3002VBE\u306e\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u3042\u308b\u300c\u30ea\u30bb\u30c3\u30c8\u300d\u30dc\u30bf\u30f3\uff08\u25a0\uff09\u3067\u3082\u505c\u6b62\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u3067\u6b62\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\uff08Ctrl+Shift+Esc\uff09\u304b\u3089Microsoft Excel\u3092\u5f37\u5236\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305f\u3060\u3057\u3053\u306e\u5834\u5408\u3001\u672a\u4fdd\u5b58\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002Application.EnableCancelKey = xlDisabled\u306e\u8a2d\u5b9a\u304c\u3042\u308b\u5834\u5408\u306fCtrl+Break\u304c\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u4e8b\u524d\u306b\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"For Next\u306e\u4ee3\u308f\u308a\u306bDo While Loop\u3067\u66f8\u3044\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u306f\u3044\u3001\u52d5\u4f5c\u4e0a\u306f\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u300c\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u51e6\u7406\u300d\u306fFor Next\u306e\u65b9\u304c\u610f\u56f3\u304c\u660e\u78ba\u306b\u4f1d\u308f\u308a\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u30fb\u4fdd\u5b88\u6027\u3092\u8003\u3048\u308b\u3068\u3001\u56fa\u5b9a\u56de\u6570\u3084\u914d\u5217\u306e\u5168\u8981\u7d20\u51e6\u7406\u306b\u306fFor Next\u30fb\u914d\u5217\u3084\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5168\u4f53\u306b\u306fFor Each\u30fb\u4ef6\u6570\u4e0d\u5b9a\u306e\u6761\u4ef6\u4ed8\u304d\u7e70\u308a\u8fd4\u3057\u306b\u306fDo While Loop\u3068\u4f7f\u3044\u5206\u3051\u308b\u306e\u304cVBA\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\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\": \"While Wend\u3068Do While Loop\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u4e21\u65b9\u3068\u3082\u524d\u5224\u5b9a\u30eb\u30fc\u30d7\u3067\u3001\u57fa\u672c\u7684\u306a\u52d5\u4f5c\u306f\u540c\u3058\u3067\u3059\u3002\u6700\u5927\u306e\u9055\u3044\u306fExit Do\uff08\u9014\u4e2d\u7d42\u4e86\uff09\u306e\u53ef\u5426\u3067\u3059\u3002While Wend\u306b\u306f\u9014\u4e2d\u7d42\u4e86\u306e\u69cb\u6587\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001Do While Loop\u306fExit Do\u3067\u3044\u3064\u3067\u3082\u30eb\u30fc\u30d7\u3092\u629c\u3051\u3089\u308c\u307e\u3059\u3002\u307e\u305f\u3001Do\u7cfb\u306fUntil\u6761\u4ef6\uff08\u6761\u4ef6\u304cFalse\u306e\u9593\u7e70\u308a\u8fd4\u3059\uff09\u306b\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u65b0\u898f\u30b3\u30fc\u30c9\u3067\u306fDo While Loop\u306e\u4f7f\u7528\u3092\u63a8\u5968\u3057\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Do While Loop\u3068Do Loop While\u306e\u4f7f\u3044\u5206\u3051\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u300c\u6700\u521d\u304b\u3089\u6761\u4ef6\u304cFalse\u306e\u5834\u5408\u306b\u30eb\u30fc\u30d7\u672c\u4f53\u3092\u5b9f\u884c\u3057\u305f\u3044\u304b\u5426\u304b\u300d\u304c\u5224\u65ad\u57fa\u6e96\u3067\u3059\u3002Do While Loop\uff08\u524d\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u304cFalse\u306a\u30890\u56de\u3082\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u3002Do Loop While\uff08\u5f8c\u5224\u5b9a\uff09\u306f\u6761\u4ef6\u306b\u95a2\u308f\u3089\u305a\u5fc5\u305a1\u56de\u306f\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u5165\u529b\u8981\u6c42\uff08\u6700\u4f4e1\u56de\u306f\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u51fa\u3059\uff09\u3084\u30ea\u30c8\u30e9\u30a4\u51e6\u7406\uff08\u5c11\u306a\u304f\u3068\u30821\u56de\u306f\u8a66\u307f\u308b\uff09\u306b\u306fDo Loop While\u304c\u81ea\u7136\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Exit Do\u3068Exit For\u306fDo\u30eb\u30fc\u30d7\u4ee5\u5916\u306b\u3082\u4f7f\u3048\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u3044\u3044\u3048\u3002Exit Do\u306fDo\u7cfb\u30eb\u30fc\u30d7\uff08Do While Loop\u30fbDo Loop While\u30fbDo Until\u7b49\uff09\u5c02\u7528\u3067\u3059\u3002For Next\u3092\u629c\u3051\u308b\u306b\u306fExit For\u3092\u4f7f\u3044\u307e\u3059\u3002While Wend\u306b\u306f\u5bfe\u5fdc\u3059\u308bExit Wend\u304c\u3042\u308a\u307e\u305b\u3093\u3002While Wend\u3092\u9014\u4e2d\u7d42\u4e86\u3055\u305b\u308b\u306b\u306f\u3001GoTo\u3067Wend\u306e\u6b21\u306e\u30e9\u30d9\u30eb\u306b\u98db\u3076\u65b9\u6cd5\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u3053\u308c\u304cWhile Wend\u3088\u308aDo WhileLoop\u3092\u63a8\u5968\u3059\u308b\u7406\u7531\u306e\u4e00\u3064\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u3063\u305f\u3068\u304d\u306e\u6b62\u3081\u65b9\u3092\u6559\u3048\u3066\u304f\u3060\u3055\u3044\u3002\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Ctrl+Break\uff08Break\u30ad\u30fc\u304c\u306a\u3044\u5834\u5408\u306fCtrl+Pause\uff09\u3067VBA\u30de\u30af\u30ed\u3092\u5f37\u5236\u505c\u6b62\u3067\u304d\u307e\u3059\u3002VBE\u306e\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u3042\u308b\u300c\u30ea\u30bb\u30c3\u30c8\u300d\u30dc\u30bf\u30f3\uff08\u25a0\uff09\u3067\u3082\u505c\u6b62\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3089\u3067\u6b62\u307e\u3089\u306a\u3044\u5834\u5408\u306f\u3001\u30bf\u30b9\u30af\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\uff08Ctrl+Shift+Esc\uff09\u304b\u3089Microsoft Excel\u3092\u5f37\u5236\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u305f\u3060\u3057\u3053\u306e\u5834\u5408\u3001\u672a\u4fdd\u5b58\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002Application.EnableCancelKey = xlDisabled\u306e\u8a2d\u5b9a\u304c\u3042\u308b\u5834\u5408\u306fCtrl+Break\u304c\u7121\u52b9\u5316\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u4e8b\u524d\u306b\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"For Next\u306e\u4ee3\u308f\u308a\u306bDo While Loop\u3067\u66f8\u3044\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u306f\u3044\u3001\u52d5\u4f5c\u4e0a\u306f\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002\u305f\u3060\u3057\u300c\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u4e8b\u524d\u306b\u6c7a\u307e\u3063\u3066\u3044\u308b\u51e6\u7406\u300d\u306fFor Next\u306e\u65b9\u304c\u610f\u56f3\u304c\u660e\u78ba\u306b\u4f1d\u308f\u308a\u307e\u3059\u3002\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u30fb\u4fdd\u5b88\u6027\u3092\u8003\u3048\u308b\u3068\u3001\u56fa\u5b9a\u56de\u6570\u3084\u914d\u5217\u306e\u5168\u8981\u7d20\u51e6\u7406\u306b\u306fFor Next\u30fb\u914d\u5217\u3084\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u5168\u4f53\u306b\u306fFor Each\u30fb\u4ef6\u6570\u4e0d\u5b9a\u306e\u6761\u4ef6\u4ed8\u304d\u7e70\u308a\u8fd4\u3057\u306b\u306fDo While Loop\u3068\u4f7f\u3044\u5206\u3051\u308b\u306e\u304cVBA\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3067\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n\n<h3 class=\"wp-block-heading\">VBA\u306eWhile\u30fbDo While\u30eb\u30fc\u30d7\u8a2d\u8a08\u3092\u3001Claude Code\u3067\u52b9\u7387\u5316<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30eb\u30fc\u30d7\u304c\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u300d\u300cExit Do\u3092\u3069\u3053\u306b\u5165\u308c\u308c\u3070\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u3044\u300d\u300cDo While\u3068For Next\u3092\u3044\u3064\u4f7f\u3044\u5206\u3051\u308c\u3070\u3088\u3044\u304b\u5224\u65ad\u3067\u304d\u306a\u3044\u300d\u2014\u2014VBA\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u306b\u95a2\u3059\u308b\u7591\u554f\u3084\u5b9f\u88c5\u306e\u58c1\u3092\u3001Claude Code\u3092\u4f7f\u3063\u305f\u696d\u52d9\u52b9\u7387\u5316\u3067\u89e3\u6c7a\u3057\u307e\u305b\u3093\u304b\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\">\u30eb\u30fc\u30d7\u6761\u4ef6\u306e\u8a2d\u8a08\u30fb\u5b89\u5168\u4e0a\u9650\u306e\u7d44\u307f\u8fbc\u307f\u30fbExit Do\u306b\u3088\u308b\u6b63\u3057\u3044\u9014\u4e2d\u7d42\u4e86\u8a2d\u8a08\u306a\u3069\u3001\u696d\u52d9\u30de\u30af\u30ed\u306e\u30eb\u30fc\u30d7\u51e6\u7406\u3092\u3088\u308a\u5805\u7262\u306b\u66f8\u304f\u305f\u3081\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305a\u306f\u7121\u6599\u76f8\u8ac7\u3067\u304a\u6c17\u8efd\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\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-while-loop&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","protected":false},"excerpt":{"rendered":"<p>VBA\u306eWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u9055\u3044\u3068\u4f7f\u3044\u5206\u3051\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u6761\u4ef6\u4ed8\u304d\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e\u57fa\u672c\u69cb\u6587\u3001\u8907\u6570\u6761\u4ef6\u306e\u6307\u5b9a\u3001Exit Do\u306b\u3088\u308b\u9014\u4e2d\u7d42\u4e86\u3001For Next\u3068\u306e\u4f7f\u3044\u5206\u3051\u307e\u3067\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002<\/p>\n","protected":false},"author":1,"featured_media":18394,"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\u306eWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u9055\u3044\u3068\u4f7f\u3044\u5206\u3051\u3092\u5b8c\u5168\u89e3\u8aac\u3002\u6761\u4ef6\u4ed8\u304d\u7e70\u308a\u8fd4\u3057\u51e6\u7406\u306e\u57fa\u672c\u69cb\u6587\u3001\u8907\u6570\u6761\u4ef6\u306e\u6307\u5b9a\u3001Exit Do\u306b\u3088\u308b\u9014\u4e2d\u7d42\u4e86\u3001For Next\u3068\u306e\u4f7f\u3044\u5206\u3051\u307e\u3067\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002","rank_math_focus_keyword":"VBA While Do While","rank_math_title":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306eWhile\u30fbDo While\u30eb\u30fc\u30d7\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cWhile Wend\u30fbDo While Loop\u30fbDo Loop While\u306e\u4f7f\u3044\u5206\u3051\u3068\u30b3\u30fc\u30c9\u4f8b","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":[2],"tags":[],"class_list":["post-18395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-claude-tips"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18395","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=18395"}],"version-history":[{"count":1,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18395\/revisions"}],"predecessor-version":[{"id":18396,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18395\/revisions\/18396"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/18394"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=18395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=18395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=18395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}