{"id":18360,"date":"2026-07-19T02:49:15","date_gmt":"2026-07-18T17:49:15","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=18360"},"modified":"2026-07-19T02:49:15","modified_gmt":"2026-07-18T17:49:15","slug":"cc-vba-error-handling-2","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-vba-error-handling-2\/","title":{"rendered":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cOn Error\u30fbResume\u30fbGoTo\u306e\u4f7f\u3044\u65b9\u3068Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6d3b\u7528\u6cd5"},"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-error-handling-1.jpg\" alt=\"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cOn Error\u30fbResume\u30fbGoTo\u306e\u4f7f\u3044\u65b9\u3068Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6d3b\u7528\u6cd5\" 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\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u57fa\u672c\u6982\u5ff5\u3068\u7a2e\u985e<\/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>On Error GoTo\uff1a\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306b\u30e9\u30d9\u30eb\u3078\u30b8\u30e3\u30f3\u30d7<\/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>On Error Resume Next\uff1a\u30a8\u30e9\u30fc\u3092\u7121\u8996\u3057\u3066\u6b21\u306e\u884c\u3078<\/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>Resume\u30fbResume Next\u30fbResume \u30e9\u30d9\u30eb\u306e\u4f7f\u3044\u5206\u3051<\/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>Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff1aNumber\u30fbDescription\u30fbSource\u306e\u6d3b\u7528<\/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>\u30a8\u30e9\u30fc\u756a\u53f7\u306b\u3088\u308bSelect Case\u5206\u5c90<\/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>On Error GoTo 0\uff1a\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u7121\u52b9\u5316<\/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>\u696d\u52d9\u30de\u30af\u30ed\u3067\u306e\u5b9f\u8df5\u30a8\u30e9\u30fc\u51e6\u7406\u30d1\u30bf\u30fc\u30f3<\/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>\u3088\u304f\u3042\u308b\u5931\u6557\u3068\u30c7\u30d0\u30c3\u30b0\u306e\u30b3\u30c4<\/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>Claude Code\u3067VBA\u30a8\u30e9\u30fc\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210<\/a><\/li>\n    <li><a href=\"#sec-11\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">11<\/span>\u307e\u3068\u3081<\/a><\/li>\n    <li><a href=\"#faq\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">FAQ<\/span>\u3088\u304f\u3042\u308b\u8cea\u554f<\/a><\/li>\n  <\/ol>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30de\u30af\u30ed\u3092\u8ab0\u304b\u306b\u4f7f\u3063\u3066\u3082\u3089\u3063\u305f\u3089\u3001\u4e88\u671f\u3057\u306a\u3044\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u3063\u3066\u3057\u307e\u3063\u305f\u300d\u300c\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u3068\u304d\u306b\u30de\u30af\u30ed\u304c\u9014\u4e2d\u3067\u843d\u3061\u3066\u3001\u30c7\u30fc\u30bf\u304c\u4e2d\u9014\u534a\u7aef\u306a\u72b6\u614b\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u300d\u2014\u2014VBA\u30de\u30af\u30ed\u3092\u672c\u683c\u7684\u306b\u696d\u52d9\u3067\u4f7f\u3044\u59cb\u3081\u308b\u3068\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u91cd\u8981\u6027\u3092\u75db\u611f\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\u306f\u300c\u66f8\u304b\u306a\u304f\u3066\u3082\u52d5\u304f\u30b3\u30fc\u30c9\u300d\u3092\u300c\u58ca\u308c\u306b\u304f\u304f\u3001\u554f\u984c\u3092\u7279\u5b9a\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u300d\u306b\u5909\u3048\u308b\u5fc5\u9808\u306e\u6280\u8853\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5b8c\u5168\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002On Error GoTo\u30fbOn Error Resume Next\u30fbResume\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u306e\u4f7f\u3044\u5206\u3051\u30fbErr\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u306e\u30a8\u30e9\u30fc\u60c5\u5831\u53d6\u5f97\u30fbSelect Case\u306b\u3088\u308b\u30a8\u30e9\u30fc\u756a\u53f7\u5206\u5c90\u30fb\u696d\u52d9\u30de\u30af\u30ed\u3067\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\u307e\u3067\u3001\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\">\u5f0a\u793e\u306e\u7d4c\u9a13\u4e0a\u3001\u696d\u52d9\u30de\u30af\u30ed\u306e\u30c8\u30e9\u30d6\u30eb\u306e\u591a\u304f\u306f\u300c\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u300d\u307e\u305f\u306f\u300c\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u4e0d\u5b8c\u5168\u300d\u3067\u5f15\u304d\u8d77\u3053\u3055\u308c\u307e\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u30fb\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u30fb\u578b\u304c\u9055\u3046\u2014\u2014\u3053\u3046\u3057\u305f\u4e88\u671f\u3057\u306a\u3044\u72b6\u6cc1\u3067\u3082\u300c\u9069\u5207\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3057\u3066\u30b9\u30e0\u30fc\u30ba\u306b\u51e6\u7406\u3092\u7d42\u4e86\u3059\u308b\u300d\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u308b\u3068\u3001\u30de\u30af\u30ed\u306e\u4fe1\u983c\u6027\u304c\u5927\u5e45\u306b\u5411\u4e0a\u3057\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>VBA\u30a8\u30e9\u30fc\u306e3\u7a2e\u985e<\/strong>\uff1a\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u30fb\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u30fb\u8ad6\u7406\u30a8\u30e9\u30fc\u306e\u9055\u3044<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>On Error GoTo<\/strong>\uff1a\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306e\u51e6\u7406\u3092\u5c02\u7528\u30eb\u30fc\u30c6\u30a3\u30f3\u306b\u5207\u308a\u51fa\u3059\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>On Error Resume Next<\/strong>\uff1a\u7279\u5b9a\u306e\u884c\u306e\u30a8\u30e9\u30fc\u3092\u7121\u8996\u3059\u308b\u4f7f\u3044\u65b9\u3068\u5371\u967a\u306a\u4f7f\u3044\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>Resume\u7cfb\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\uff1a\u30a8\u30e9\u30fc\u5f8c\u306b\u3069\u3053\u304b\u3089\u51e6\u7406\u3092\u518d\u958b\u3059\u308b\u304b3\u30d1\u30bf\u30fc\u30f3\u306e\u4f7f\u3044\u5206\u3051<\/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>Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff1a\u30a8\u30e9\u30fc\u756a\u53f7\u30fb\u8aac\u660e\u30fb\u767a\u751f\u6e90\u3092\u53d6\u5f97\u3057\u3066\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u65b9\u6cd5<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u696d\u52d9\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3<\/strong>\uff1a\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u30fbDB\u63a5\u7d9a\u30fb\u5916\u90e8API\u306a\u3069\u5178\u578b\u7684\u306a\u696d\u52d9\u30a8\u30e9\u30fc\u3078\u306e\u5bfe\u51e6<\/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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">ERROR BASICS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">VBA\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u57fa\u672c\u6982\u5ff5\u3068\u7a2e\u985e<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b3\u3064\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3068\u305d\u308c\u305e\u308c\u3078\u306e\u5bfe\u51e6\u65b9\u91dd<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u30a8\u30e9\u30fc\u306b\u306f3\u7a2e\u985e\u3042\u308a\u307e\u3059\u3002\u300c\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u300d\u300c\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u300d\u300c\u8ad6\u7406\u30a8\u30e9\u30fc\u300d\u3067\u3059\u3002\u305d\u308c\u305e\u308c\u767a\u751f\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u30fb\u539f\u56e0\u30fb\u5bfe\u51e6\u65b9\u6cd5\u304c\u7570\u306a\u308a\u307e\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\uff08On Error\u6587\uff09\u3067\u5bfe\u51e6\u3067\u304d\u308b\u306e\u306f\u4e3b\u306b\u300c\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u300d\u3067\u3059\u3002<\/p>\n\n\n\n<table>\n<thead><tr><th>\u30a8\u30e9\u30fc\u306e\u7a2e\u985e<\/th><th>\u767a\u751f\u30bf\u30a4\u30df\u30f3\u30b0<\/th><th>\u539f\u56e0\u4f8b<\/th><th>\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u9632\u3052\u308b\u304b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc<\/td><td>\u30de\u30af\u30ed\u5b9f\u884c\u524d\uff08\u30b3\u30fc\u30c9\u89e3\u6790\u6642\uff09<\/td><td>\u5909\u6570\u540d\u30df\u30b9\u30fb\u69cb\u6587\u30df\u30b9\u30fbEnd Sub\u306e\u6b20\u843d<\/td><td>\u274c \u30b3\u30fc\u30c9\u306e\u4fee\u6b63\u304c\u5fc5\u8981<\/td><\/tr>\n<tr><td>\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\uff08\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\uff09<\/td><td>\u30de\u30af\u30ed\u5b9f\u884c\u4e2d<\/td><td>\u30d5\u30a1\u30a4\u30eb\u672a\u5b58\u5728\u30fb\u578b\u306e\u4e0d\u4e00\u81f4\u30fb\u30bc\u30ed\u9664\u7b97<\/td><td>\u2705 On Error\u3067\u51e6\u7406\u53ef\u80fd<\/td><\/tr>\n<tr><td>\u8ad6\u7406\u30a8\u30e9\u30fc\uff08\u30d0\u30b0\uff09<\/td><td>\u5b9f\u884c\u4e2d\uff08\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306a\u3057\uff09<\/td><td>\u8a08\u7b97\u5f0f\u306e\u9593\u9055\u3044\u30fb\u6761\u4ef6\u5206\u5c90\u306e\u30d0\u30b0<\/td><td>\u274c \u30c6\u30b9\u30c8\u30fb\u30c7\u30d0\u30c3\u30b0\u3067\u767a\u898b\u3059\u308b<\/td><\/tr>\n<\/tbody>\n<\/table>\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>\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\uff08\u30e9\u30f3\u30bf\u30a4\u30e0\u30a8\u30e9\u30fc\uff09<\/strong>\uff1aVBA\u30b3\u30fc\u30c9\u304c\u5b9f\u884c\u4e2d\u306b\u767a\u751f\u3059\u308b\u30a8\u30e9\u30fc\u3002\u69cb\u6587\u306f\u6b63\u3057\u3044\u304c\u300c\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u300d\u300c\u30c7\u30fc\u30bf\u578b\u304c\u4e0d\u4e00\u81f4\u300d\u300c\u30bc\u30ed\u9664\u7b97\u300d\u300c\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u300d\u306a\u3069\u3001\u5b9f\u884c\u3057\u3066\u307f\u306a\u3044\u3068\u5206\u304b\u3089\u306a\u3044\u7570\u5e38\u72b6\u614b\u306b\u3088\u3063\u3066\u767a\u751f\u3057\u307e\u3059\u3002On Error\u6587\u3067\u30ad\u30e3\u30c3\u30c1\u3057\u3066\u5bfe\u51e6\u3067\u304d\u307e\u3059\u3002\u767a\u751f\u3059\u308b\u3068\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u30de\u30af\u30ed\u304c\u505c\u6b62\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u66f8\u304f\u76ee\u7684\u306f\u5927\u304d\u304f2\u3064\u3067\u3059\u3002(1)\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u3067\u3082\u30de\u30af\u30ed\u3092\u300c\u9069\u5207\u306b\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u3057\u3066\u7d42\u4e86\u300d\u3055\u305b\u308b\u3053\u3068\u3002(2)\u30a8\u30e9\u30fc\u306e\u5185\u5bb9\u3092\u30e6\u30fc\u30b6\u30fc\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u4f1d\u3048\u308b\u3053\u3068\uff08\u307e\u305f\u306f\u30ed\u30b0\u306b\u8a18\u9332\u3059\u308b\u3053\u3068\uff09\u3002\u3053\u306e2\u3064\u3092\u610f\u8b58\u3057\u3066\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u8a2d\u8a08\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u30a8\u30e9\u30fc\u51e6\u7406\u306a\u3057\u306e\u30de\u30af\u30ed\u3067\u6700\u3082\u6016\u3044\u306e\u306f\u300c\u4e2d\u9014\u534a\u7aef\u306a\u72b6\u614b\u3067\u6b62\u307e\u308b\u300d\u3053\u3068\u3067\u3059\u3002\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u305f\u5f8c\u306b\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u3066\u30d5\u30a1\u30a4\u30eb\u304c\u9589\u3058\u3089\u308c\u306a\u3044\u3001\u30b7\u30fc\u30c8\u3092\u4fdd\u8b77\u89e3\u9664\u3057\u305f\u5f8c\u306b\u6b62\u307e\u3063\u3066\u4fdd\u8b77\u304c\u623b\u3089\u306a\u3044\u2014\u2014\u3053\u3046\u3057\u305f\u5f8c\u51e6\u7406\u306e\u6f0f\u308c\u304c\u3001\u30c7\u30fc\u30bf\u7834\u640d\u3084\u30d5\u30a1\u30a4\u30eb\u306e\u30ed\u30c3\u30af\u306b\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u30de\u30af\u30ed\u5b9f\u884c\u958b\u59cb<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u5b9f\u884c\u6642\u30a8\u30e9\u30fc<br>\u767a\u751f<\/strong><br><span style=\"font-size:12px;\">\u578b\u4e0d\u4e00\u81f4\u30fb\u30d5\u30a1\u30a4\u30eb\u672a\u5b58\u5728\u7b49<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>On Error<br>\u304c\u51e6\u7406\u3092\u30ad\u30e3\u30c3\u30c1<\/strong><br><span style=\"font-size:12px;\">GoTo or Resume<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30a8\u30e9\u30fc\u51e6\u7406<br>\u30eb\u30fc\u30c6\u30a3\u30f3\u5b9f\u884c<\/strong><br><span style=\"font-size:12px;\">\u30e1\u30c3\u30bb\u30fc\u30b8\u8868\u793a\u30fb\u30ed\u30b0\u8a18\u9332<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u6b63\u5e38\u7d42\u4e86 or<br>\u30ea\u30ab\u30d0\u30ea\u51e6\u7406<\/strong><\/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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">ON ERROR GOTO<\/span>\n  <span class=\"section-title\" style=\"display:block;\">On Error GoTo\uff1a\u30a8\u30e9\u30fc\u767a\u751f\u6642\u306b\u30e9\u30d9\u30eb\u3078\u30b8\u30e3\u30f3\u30d7<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3002\u5f8c\u51e6\u7406\u304c\u5fc5\u8981\u306a\u696d\u52d9\u30de\u30af\u30ed\u306b\u5fc5\u9808<\/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>On Error GoTo\uff08\u30aa\u30f3\u30fb\u30a8\u30e9\u30fc\u30fb\u30b4\u30fc\u30c8\u30a5\uff09<\/strong>\uff1aVBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u6709\u52b9\u5316\u69cb\u6587\u3002\u300cOn Error GoTo \u30e9\u30d9\u30eb\u540d\u300d\u3068\u66f8\u304f\u3068\u3001\u4ee5\u964d\u306e\u30b3\u30fc\u30c9\u3067\u5b9f\u884c\u6642\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u81ea\u52d5\u7684\u306b\u6307\u5b9a\u30e9\u30d9\u30eb\u3078\u30b8\u30e3\u30f3\u30d7\u3057\u307e\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u3092\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u672b\u5c3e\u306b\u30e9\u30d9\u30eb\u3067\u914d\u7f6e\u3057\u3001\u901a\u5e38\u51e6\u7406\u306e\u672b\u5c3e\u306b\u306fExit Sub\u3092\u7f6e\u304f\u306e\u304c\u6a19\u6e96\u30d1\u30bf\u30fc\u30f3\u3002On Error GoTo 0\u3067\u7121\u52b9\u5316\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cOn Error GoTo \u30e9\u30d9\u30eb\u540d\u300d\u306f\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u6307\u5b9a\u3057\u305f\u30e9\u30d9\u30eb\u306e\u4f4d\u7f6e\u306b\u30b8\u30e3\u30f3\u30d7\u3059\u308b\u69cb\u6587\u3067\u3059\u3002\u3053\u308c\u304cVBA\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u6700\u3082\u57fa\u672c\u7684\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u3092\u95a2\u6570\u306e\u672b\u5c3e\u306b\u30e9\u30d9\u30eb\uff08\u4f8b\uff1aErrorHandler:\uff09\u3068\u3057\u3066\u914d\u7f6e\u3057\u3001\u901a\u5e38\u306e\u51e6\u7406\u306e\u672b\u5c3e\u306b\u306f\u300cExit Sub\u300d\u3092\u5165\u308c\u308b\u3053\u3068\u3067\u3001\u30a8\u30e9\u30fc\u304c\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u30b9\u30ad\u30c3\u30d7\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; On Error GoTo\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\nSub SampleErrorHandling()\n    &#x27; \u2190 \u3053\u3053\u3067\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u6709\u52b9\u5316\n    On Error GoTo ErrorHandler\n\n    &#x27; === \u901a\u5e38\u306e\u51e6\u7406 ===\n    Dim wb As Workbook\n    Set wb = Workbooks.Open(&quot;C:\\Data\\report.xlsx&quot;)  &#x27; \u2190 \u3053\u3053\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u308b\u53ef\u80fd\u6027\n\n    Cells(1, 1).Value = wb.Sheets(1).Cells(1, 1).Value\n    wb.Close False\n\n    MsgBox &quot;\u51e6\u7406\u304c\u6b63\u5e38\u306b\u5b8c\u4e86\u3057\u307e\u3057\u305f&quot;\n    Exit Sub  &#x27; \u2190 \u30a8\u30e9\u30fc\u304c\u306a\u3044\u5834\u5408\u3053\u3053\u3067\u7d42\u4e86\uff08ErrorHandler\u3092\u30b9\u30ad\u30c3\u30d7\uff09\n\n&#x27; === \u30a8\u30e9\u30fc\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3 ===\nErrorHandler:\n    MsgBox &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; _\n           &quot;\u30a8\u30e9\u30fc\u756a\u53f7: &quot; &amp; Err.Number &amp; vbCrLf &amp; _\n           &quot;\u5185\u5bb9: &quot; &amp; Err.Description, vbCritical, &quot;\u30a8\u30e9\u30fc&quot;\n    &#x27; \u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u306a\u3069\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\n    If Not wb Is Nothing Then\n        If wb.ReadOnly = False Then wb.Close False\n    End If\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>GoTo\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/strong>\uff1a\u6307\u5b9a\u3057\u305f\u30e9\u30d9\u30eb\u306e\u4f4d\u7f6e\u306b\u51e6\u7406\u3092\u30b8\u30e3\u30f3\u30d7\u3055\u305b\u308bVBA\u306e\u69cb\u6587\u3002\u901a\u5e38\u306f\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u3092\u4e0b\u3052\u308b\u305f\u3081\u591a\u7528\u3092\u907f\u3051\u307e\u3059\u304c\u3001\u30a8\u30e9\u30fc\u51e6\u7406\uff08On Error GoTo\uff09\u3067\u306e\u4f7f\u7528\u306f\u6163\u7528\u7684\u306b\u8a8d\u3081\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u30e9\u30d9\u30eb\u306f\u300c\u30e9\u30d9\u30eb\u540d:\uff08\u30b3\u30ed\u30f3\uff09\u300d\u306e\u5f62\u5f0f\u3067\u884c\u982d\u306b\u914d\u7f6e\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2-1. Exit Sub\u3092\u5fd8\u308c\u306a\u3044\u3053\u3068\u304c\u6700\u91cd\u8981<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On Error GoTo\u30d1\u30bf\u30fc\u30f3\u3067\u6700\u3082\u5fd8\u308c\u3084\u3059\u3044\u306e\u304c\u300cExit Sub\u300d\u3067\u3059\u3002\u901a\u5e38\u306e\u51e6\u7406\u306e\u672b\u5c3e\u306bExit Sub\u3092\u66f8\u304b\u306a\u3044\u3068\u3001\u30a8\u30e9\u30fc\u304c\u306a\u304b\u3063\u305f\u5834\u5408\u3067\u3082\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u305d\u306e\u307e\u307eErrorHandler\u30e9\u30d9\u30eb\u306b\u6d41\u308c\u8fbc\u3093\u3067\u3057\u307e\u3044\u307e\u3059\u3002\u300c\u306a\u305c\u304b\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u51fa\u308b\u306e\u306b\u30c7\u30d0\u30c3\u30b0\u3057\u3066\u3082\u554f\u984c\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u300d\u3068\u3044\u3046\u5834\u5408\u3001Exit Sub\u306e\u66f8\u304d\u5fd8\u308c\u304c\u539f\u56e0\u306e\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Exit Sub\u304c\u306a\u3044\u3068\u554f\u984c\u306b\u306a\u308b\u4f8b\nSub BadExample()\n    On Error GoTo ErrorHandler\n\n    MsgBox &quot;\u6b63\u5e38\u51e6\u7406&quot;\n    &#x27; \u2190 Exit Sub\u304c\u306a\u3044\uff01\n    &#x27; \u6b63\u5e38\u306b\u7d42\u308f\u3063\u3066\u3082\u6b21\u306e\u884c\u306b\u9032\u3093\u3067\u3057\u307e\u3046\n\nErrorHandler:\n    MsgBox &quot;\u30a8\u30e9\u30fc&quot;  &#x27; \u2190 \u6b63\u5e38\u6642\u3082\u3053\u3053\u304c\u5b9f\u884c\u3055\u308c\u3066\u3057\u307e\u3046\uff01\nEnd Sub\n\n&#x27; ===\nSub GoodExample()\n    On Error GoTo ErrorHandler\n\n    MsgBox &quot;\u6b63\u5e38\u51e6\u7406&quot;\n    Exit Sub  &#x27; \u2190 \u5fc5\u305aExit Sub\u3067ErrorHandler\u3092\u30b9\u30ad\u30c3\u30d7\n\nErrorHandler:\n    MsgBox &quot;\u30a8\u30e9\u30fc&quot;  &#x27; \u2190 \u30a8\u30e9\u30fc\u6642\u3060\u3051\u5b9f\u884c\u3055\u308c\u308b\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\">ErrorHandler\u306e\u524d\u306b\u5fc5\u305aExit Sub\u3092\u66f8\u304f\u2014\u2014\u3053\u308c\u306fVBA\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u300c\u9244\u5247\u300d\u3067\u3059\u3002\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u899a\u3048\u3066\u304a\u304f\u3053\u3068\u3067\u3001\u66f8\u304d\u5fd8\u308c\u3092\u9632\u3052\u307e\u3059\u3002\u300cOn Error GoTo ErrorHandler\u300d\u3067\u59cb\u307e\u308a\u300cExit Sub \/ ErrorHandler: \/ \u30a8\u30e9\u30fc\u51e6\u7406\u300d\u3067\u7d42\u308f\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u30bb\u30c3\u30c8\u3067\u899a\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">RESUME NEXT<\/span>\n  <span class=\"section-title\" style=\"display:block;\">On Error Resume Next\uff1a\u30a8\u30e9\u30fc\u3092\u7121\u8996\u3057\u3066\u6b21\u306e\u884c\u3078<\/span>\n  <span class=\"section-desc\">\u4f7f\u3044\u3069\u3053\u308d\u3068\u5371\u967a\u306a\u4f7f\u3044\u65b9\u3001\u6b63\u3057\u3044\u4f7f\u7528\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>On Error Resume Next<\/strong>\uff1a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3082\u51e6\u7406\u3092\u505c\u6b62\u305b\u305a\u6b21\u306e\u884c\u304b\u3089\u5b9f\u884c\u3092\u7d9a\u3051\u308b\u69cb\u6587\u3002\u30eb\u30fc\u30d7\u51e6\u7406\u3067\u306e\u884c\u30b9\u30ad\u30c3\u30d7\u30fb\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5b58\u5728\u78ba\u8a8d\u30fb\u4efb\u610f\u51e6\u7406\u306a\u3069\u3001\u7279\u5b9a\u306e\u884c\u306e\u30a8\u30e9\u30fc\u3092\u610f\u56f3\u7684\u306b\u7121\u8996\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089\u5fc5\u305aOn Error GoTo 0\u3067\u7121\u52b9\u5316\u3059\u308b\u3053\u3068\u304c\u9244\u5247\u3067\u3059\u3002On Error Resume Next\u3092\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5168\u4f53\u306b\u9069\u7528\u3059\u308b\u3068\u3001\u610f\u56f3\u3057\u306a\u3044\u30a8\u30e9\u30fc\u304c\u5168\u3066\u7121\u8996\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cOn Error Resume Next\u300d\u306f\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3082\u7121\u8996\u3057\u3066\u6b21\u306e\u884c\u304b\u3089\u51e6\u7406\u3092\u7d9a\u3051\u308b\u69cb\u6587\u3067\u3059\u3002\u300c\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3082\u51e6\u7406\u3092\u6b62\u3081\u305f\u304f\u306a\u3044\u300d\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u304c\u3001\u8aa4\u7528\u3059\u308b\u3068\u300c\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b\u3053\u3068\u306b\u6c17\u3065\u304b\u305a\u306b\u51e6\u7406\u304c\u7d9a\u304f\u300d\u5371\u967a\u306a\u30b3\u30fc\u30c9\u306b\u306a\u308a\u307e\u3059\u3002On Error Resume Next\u306f\u3001\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089\u3059\u3050\u306bOn Error GoTo 0\u3067\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u7121\u52b9\u5316\u3059\u308b\u304b\u3001On Error GoTo \u30e9\u30d9\u30eb\u3067\u901a\u5e38\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u306b\u623b\u3059\u3053\u3068\u304c\u91cd\u8981\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; On Error Resume Next\u306e\u4f7f\u3044\u65b9\nSub LoopWithErrorResumeNext()\n    On Error Resume Next  &#x27; \u30a8\u30e9\u30fc\u7121\u8996\u30e2\u30fc\u30c9\u958b\u59cb\n\n    Dim i As Integer\n    For i = 1 To 10\n        &#x27; \u4e00\u90e8\u306e\u884c\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3082\u51e6\u7406\u3092\u7d99\u7d9a\u3057\u305f\u3044\n        Cells(i, 2).Value = Cells(i, 1).Value \/ Cells(i, 3).Value\n\n        &#x27; \u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u304b\u3069\u3046\u304b\u3092Err\u3067\u78ba\u8a8d\n        If Err.Number &lt;&gt; 0 Then\n            Cells(i, 4).Value = &quot;\u8a08\u7b97\u30a8\u30e9\u30fc: &quot; &amp; Err.Description\n            Err.Clear  &#x27; \u30a8\u30e9\u30fc\u60c5\u5831\u3092\u30ea\u30bb\u30c3\u30c8\uff08\u91cd\u8981\uff01\uff09\n        End If\n    Next i\n\n    On Error GoTo 0  &#x27; \u30a8\u30e9\u30fc\u7121\u8996\u30e2\u30fc\u30c9\u7d42\u4e86\uff08\u5fc5\u9808\uff09\n\n    MsgBox &quot;\u5168\u884c\u51e6\u7406\u5b8c\u4e86&quot;\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;\">On Error Resume Next\u306e\u5371\u967a\u306a\u4f7f\u3044\u65b9<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u300cOn Error Resume Next\u3092\u66f8\u3044\u3066\u30a8\u30e9\u30fc\u304c\u51fa\u306a\u304f\u306a\u3063\u305f\u300d\u3068\u3044\u3046\u306e\u306f\u3001\u30a8\u30e9\u30fc\u3092\u7121\u8996\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u554f\u984c\u304c\u89e3\u6c7a\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u51e6\u7406\u304c\u9014\u4e2d\u3067\u30b9\u30ad\u30c3\u30d7\u3055\u308c\u305f\u308a\u3001\u610f\u56f3\u3057\u306a\u3044\u5024\u304c\u8a2d\u5b9a\u3055\u308c\u305f\u308a\u3057\u307e\u3059\u3002\u7279\u306b\u300c\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u51e6\u7406\u300d\u306e\u524d\u306bOn Error Resume Next\u3092\u66f8\u304f\u3068\u3001\u30a8\u30e9\u30fc\u3067\u5931\u6557\u3057\u305f\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002On Error Resume Next\u306e\u76f4\u5f8c\u306f\u5fc5\u305aErr.Number\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u304b\u3001On Error GoTo 0\u3067\u7121\u52b9\u5316\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\">On Error Resume Next\u3092\u4f7f\u3046\u5178\u578b\u7684\u306a\u6b63\u3057\u3044\u30b1\u30fc\u30b9\u306f\u300c\u30d5\u30a1\u30a4\u30eb\u30fb\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3059\u308b\u304b\u3069\u3046\u304b\u306e\u78ba\u8a8d\u300d\u3067\u3059\u3002If Dir(filepath) <> \"\" Then \u3067\u30d5\u30a1\u30a4\u30eb\u5b58\u5728\u78ba\u8a8d\u3082\u3067\u304d\u307e\u3059\u304c\u3001On Error Resume Next + Err.Number\u3067\u78ba\u8a8d\u3059\u308b\u66f8\u304d\u65b9\u3082\u6163\u7528\u7684\u306b\u4f7f\u308f\u308c\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; \u30b7\u30fc\u30c8\u306e\u5b58\u5728\u78ba\u8a8d\u306bOn Error Resume Next\u3092\u4f7f\u3046\u4f8b\nFunction SheetExists(wsName As String) As Boolean\n    On Error Resume Next\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(wsName)  &#x27; \u5b58\u5728\u3057\u306a\u3044\u540d\u524d\u3092\u6307\u5b9a\u3059\u308b\u3068\u30a8\u30e9\u30fc\n    On Error GoTo 0  &#x27; \u3059\u3050\u306b\u7121\u52b9\u5316\n\n    SheetExists = Not ws Is Nothing\nEnd Function\n\n&#x27; \u4f7f\u3044\u65b9\nSub TestSheetExists()\n    If SheetExists(&quot;\u30c7\u30fc\u30bf&quot;) Then\n        MsgBox &quot;\u300c\u30c7\u30fc\u30bf\u300d\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u307e\u3059&quot;\n    Else\n        MsgBox &quot;\u300c\u30c7\u30fc\u30bf\u300d\u30b7\u30fc\u30c8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093&quot;\n    End If\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">RESUME TYPES<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Resume\u30fbResume Next\u30fbResume \u30e9\u30d9\u30eb\u306e\u4f7f\u3044\u5206\u3051<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u5f8c\u306e\u51e6\u7406\u518d\u958b\u4f4d\u7f6e\u30923\u30d1\u30bf\u30fc\u30f3\u3067\u5236\u5fa1\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On Error GoTo\u3067\u30a8\u30e9\u30fc\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u306b\u98db\u3093\u3060\u5f8c\u3001\u51e6\u7406\u3092\u518d\u958b\u3057\u305f\u3044\u5834\u5408\u306f\u300cResume\u300d\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u4f7f\u3044\u307e\u3059\u3002Resume\u306b\u306f3\u3064\u306e\u5f62\u5f0f\u304c\u3042\u308a\u3001\u30a8\u30e9\u30fc\u5f8c\u306b\u3069\u3053\u304b\u3089\u51e6\u7406\u3092\u518d\u958b\u3059\u308b\u304b\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<table>\n<thead><tr><th>\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8<\/th><th>\u518d\u958b\u4f4d\u7f6e<\/th><th>\u4f7f\u3046\u5834\u9762<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Resume<\/td><td>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u884c\u306b\u623b\u3063\u3066\u518d\u5b9f\u884c<\/td><td>\u30a8\u30e9\u30fc\u3092\u4fee\u6b63\u30fb\u56de\u907f\u3057\u305f\u5f8c\u306b\u540c\u3058\u884c\u3092\u518d\u8a66\u884c\u3057\u305f\u3044\u5834\u5408<\/td><\/tr>\n<tr><td>Resume Next<\/td><td>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u884c\u306e\u6b21\u306e\u884c\u304b\u3089\u518d\u958b<\/td><td>\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u884c\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u7d9a\u304d\u3092\u5b9f\u884c\u3057\u305f\u3044\u5834\u5408<\/td><\/tr>\n<tr><td>Resume \u30e9\u30d9\u30eb\u540d<\/td><td>\u6307\u5b9a\u3057\u305f\u30e9\u30d9\u30eb\u306e\u4f4d\u7f6e\u304b\u3089\u518d\u958b<\/td><td>\u7279\u5b9a\u306e\u51e6\u7406\u30b9\u30c6\u30c3\u30d7\u304b\u3089\u518d\u958b\u3057\u305f\u3044\u5834\u5408<\/td><\/tr>\n<\/tbody>\n<\/table>\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; Resume\u3067\u540c\u3058\u884c\u3092\u518d\u8a66\u884c\u3059\u308b\u4f8b\uff08\u30d5\u30a1\u30a4\u30eb\u30ed\u30c3\u30af\u5bfe\u5fdc\uff09\nSub OpenWithRetry()\n    Dim filePath As String\n    Dim retryCount As Integer\n    filePath = &quot;C:\\Data\\shared_report.xlsx&quot;\n    retryCount = 0\n\n    On Error GoTo ErrorHandler\n\n    Dim wb As Workbook\n    Set wb = Workbooks.Open(filePath)\n\n    &#x27; ... \u30c7\u30fc\u30bf\u51e6\u7406 ...\n    wb.Close False\n    Exit Sub\n\nErrorHandler:\n    If Err.Number = 1004 And retryCount &lt; 3 Then\n        &#x27; \u30d5\u30a1\u30a4\u30eb\u304c\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027 \u2192 3\u79d2\u5f85\u3063\u3066\u518d\u8a66\u884c\n        retryCount = retryCount + 1\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u958b\u3051\u307e\u305b\u3093\u3002&quot; &amp; retryCount &amp; &quot;\u79d2\u5f8c\u306b\u518d\u8a66\u884c\u3057\u307e\u3059...&quot;\n        Application.Wait Now + TimeValue(&quot;00:00:03&quot;)\n        Err.Clear\n        Resume  &#x27; \u2190 \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u884c\uff08Set wb = ...\uff09\u3092\u518d\u5b9f\u884c\n    Else\n        MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f: &quot; &amp; Err.Description, vbCritical\n    End If\nEnd Sub<\/pre>\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; Resume Next\u3067\u30a8\u30e9\u30fc\u884c\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u7d9a\u304d\u3092\u51e6\u7406\nSub ProcessAllSheets()\n    On Error GoTo ErrorHandler\n\n    Dim ws As Worksheet\n    For Each ws In ThisWorkbook.Sheets\n        &#x27; \u5404\u30b7\u30fc\u30c8\u306b\u30d8\u30c3\u30c0\u30fc\u3092\u8a2d\u5b9a\uff08\u4fdd\u8b77\u30b7\u30fc\u30c8\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u53ef\u80fd\u6027\uff09\n        ws.Cells(1, 1).Value = &quot;\u51e6\u7406\u65e5\u6642&quot;\n        ws.Cells(1, 2).Value = Now()\n    Next ws\n    Exit Sub\n\nErrorHandler:\n    &#x27; \u4fdd\u8b77\u30b7\u30fc\u30c8\u306f\u7121\u8996\u3057\u3066\u6b21\u306e\u30b7\u30fc\u30c8\u3078\n    If Err.Number = 1004 Then  &#x27; \u4fdd\u8b77\u30a8\u30e9\u30fc\n        Err.Clear\n        Resume Next  &#x27; \u2190 \u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u6b21\u306e\u884c\uff08Next ws\uff09\u304b\u3089\u518d\u958b \u2192 \u6b21\u306e\u30b7\u30fc\u30c8\u3078\n    Else\n        MsgBox &quot;\u4e88\u671f\u305b\u306c\u30a8\u30e9\u30fc: &quot; &amp; Err.Description, 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\">Resume\uff08\u540c\u3058\u884c\u3092\u518d\u5b9f\u884c\uff09\u306f\u7121\u9650\u30eb\u30fc\u30d7\u306b\u306a\u308b\u30ea\u30b9\u30af\u304c\u3042\u308a\u307e\u3059\u3002\u518d\u8a66\u884c\u56de\u6570\u3092\u30ab\u30a6\u30f3\u30c8\u3057\u3066\u4e0a\u9650\u3092\u8a2d\u3051\u308b\uff08retryCount < 3 \u306a\u3069\uff09\u306e\u304c\u696d\u52d9\u30de\u30af\u30ed\u3067\u306e\u9244\u5247\u3067\u3059\u3002Resume Next\u306f\u300c\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u7d9a\u884c\u300d\u306a\u306e\u3067\u3001\u30b9\u30ad\u30c3\u30d7\u306b\u3088\u3063\u3066\u30c7\u30fc\u30bf\u304c\u6b20\u640d\u30fb\u4e0d\u6574\u5408\u306b\u306a\u3089\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u4f7f\u3044\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">ERR OBJECT<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff1aNumber\u30fbDescription\u30fbSource\u306e\u6d3b\u7528<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u30ed\u30b0\u8a18\u9332\u30fb\u539f\u56e0\u7279\u5b9a\u306b\u6d3b\u304b\u3059<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u76f4\u8fd1\u306b\u767a\u751f\u3057\u305f\u30a8\u30e9\u30fc\u306e\u60c5\u5831\u3092\u683c\u7d0d\u3059\u308bVBA\u7d44\u307f\u8fbc\u307f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002Number\uff08\u30a8\u30e9\u30fc\u756a\u53f7\uff09\u30fbDescription\uff08\u30a8\u30e9\u30fc\u306e\u8aac\u660e\u6587\uff09\u30fbSource\uff08\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u6240\uff09\u306e3\u3064\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u304c\u4e3b\u8981\u306a\u3082\u306e\u3067\u3059\u3002\u30a8\u30e9\u30fc\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u306e\u4e2d\u3067\u3053\u308c\u3089\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3067\u3001\u3069\u3093\u306a\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u304b\u3092\u7279\u5b9a\u3067\u304d\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>Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff1aVBA\u306b\u7d44\u307f\u8fbc\u307e\u308c\u305f\u30a8\u30e9\u30fc\u60c5\u5831\u683c\u7d0d\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3002\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068Number\u30fbDescription\u30fbSource\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u60c5\u5831\u304c\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002Err.Clear()\u3067\u30a8\u30e9\u30fc\u60c5\u5831\u3092\u30ea\u30bb\u30c3\u30c8\u3067\u304d\u307e\u3059\u3002\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066\u3044\u306a\u3044\u3068\u304d\u306fErr.Number = 0\u3067\u3059\u3002On Error Resume Next\u4f7f\u7528\u6642\u306f\u51e6\u7406\u306e\u76f4\u5f8c\u306bErr.Number\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u30a8\u30e9\u30fc\u3092\u691c\u77e5\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30d7\u30ed\u30d1\u30c6\u30a3<\/th><th>\u5185\u5bb9<\/th><th>\u578b<\/th><th>\u4f7f\u7528\u4f8b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Err.Number<\/td><td>\u30a8\u30e9\u30fc\u756a\u53f7\uff08\u6574\u6570\uff09\u3002\u30a8\u30e9\u30fc\u306a\u3057\u306f0<\/td><td>Long<\/td><td>If Err.Number = 11 Then\uff08\u30bc\u30ed\u9664\u7b97\uff09<\/td><\/tr>\n<tr><td>Err.Description<\/td><td>\u30a8\u30e9\u30fc\u306e\u8aac\u660e\u6587\uff08\u6587\u5b57\u5217\uff09<\/td><td>String<\/td><td>MsgBox Err.Description<\/td><\/tr>\n<tr><td>Err.Source<\/td><td>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\/\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d<\/td><td>String<\/td><td>MsgBox Err.Source<\/td><\/tr>\n<tr><td>Err.Clear()<\/td><td>\u30a8\u30e9\u30fc\u60c5\u5831\u3092\u30ea\u30bb\u30c3\u30c8\uff08Number=0\u306b\u623b\u3059\uff09<\/td><td>\u30e1\u30bd\u30c3\u30c9<\/td><td>Err.Clear\uff08\u5f15\u6570\u306a\u3057\uff09<\/td><\/tr>\n<\/tbody>\n<\/table>\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; Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u8a73\u7d30\u306a\u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u8a18\u9332\u3059\u308b\u4f8b\nSub LoggingErrorHandler()\n    On Error GoTo ErrorHandler\n\n    &#x27; === \u51e6\u7406 ===\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u30c7\u30fc\u30bf&quot;)  &#x27; \u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u30a8\u30e9\u30fc\n\n    Dim total As Double\n    total = ws.Cells(1, 1).Value \/ ws.Cells(1, 2).Value  &#x27; \u30bc\u30ed\u9664\u7b97\u306e\u30ea\u30b9\u30af\n\n    MsgBox &quot;\u7d50\u679c: &quot; &amp; total\n    Exit Sub\n\nErrorHandler:\n    &#x27; \u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u30b7\u30fc\u30c8\u306b\u8a18\u9332\n    Dim logWs As Worksheet\n    On Error Resume Next  &#x27; \u30ed\u30b0\u30b7\u30fc\u30c8\u53d6\u5f97\u306b\u5931\u6557\u3057\u3066\u3082\u6b62\u3081\u306a\u3044\n    Set logWs = ThisWorkbook.Sheets(&quot;\u30a8\u30e9\u30fc\u30ed\u30b0&quot;)\n    On Error GoTo 0\n\n    If Not logWs Is Nothing Then\n        Dim nextRow As Long\n        nextRow = logWs.Cells(logWs.Rows.Count, 1).End(xlUp).Row + 1\n        logWs.Cells(nextRow, 1).Value = Now()           &#x27; \u65e5\u6642\n        logWs.Cells(nextRow, 2).Value = Err.Number      &#x27; \u30a8\u30e9\u30fc\u756a\u53f7\n        logWs.Cells(nextRow, 3).Value = Err.Description &#x27; \u30a8\u30e9\u30fc\u5185\u5bb9\n        logWs.Cells(nextRow, 4).Value = Err.Source      &#x27; \u767a\u751f\u5143\n    End If\n\n    &#x27; \u30e6\u30fc\u30b6\u30fc\u3078\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\n    MsgBox &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff08No.&quot; &amp; Err.Number &amp; &quot;\uff09&quot; &amp; vbCrLf &amp; _\n           Err.Description, vbCritical, &quot;\u30a8\u30e9\u30fc&quot;\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\">\u30a8\u30e9\u30fc\u30ed\u30b0\u3092\u30b7\u30fc\u30c8\u306b\u8a18\u9332\u3059\u308b\u5b9f\u88c5\u306f\u3001\u672c\u756a\u7a3c\u50cd\u3057\u3066\u3044\u308b\u30de\u30af\u30ed\u3067\u975e\u5e38\u306b\u6709\u52b9\u3067\u3059\u3002\u5f8c\u304b\u3089\u300c\u3044\u3064\u30fb\u3069\u3093\u306a\u30a8\u30e9\u30fc\u304c\u30fb\u3069\u3053\u3067\u767a\u751f\u3057\u305f\u304b\u300d\u3092\u8ffd\u8de1\u3067\u304d\u3001\u518d\u767a\u9632\u6b62\u306b\u3082\u5f79\u7acb\u3061\u307e\u3059\u3002Sheets(\"\u30a8\u30e9\u30fc\u30ed\u30b0\")\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306bOn Error Resume Next\u3067\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u70b9\u3082\u30dd\u30a4\u30f3\u30c8\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">SELECT CASE ERROR<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u30a8\u30e9\u30fc\u756a\u53f7\u306b\u3088\u308bSelect Case\u5206\u5c90<\/span>\n  <span class=\"section-desc\">\u4e3b\u8981\u306aVBA\u30a8\u30e9\u30fc\u756a\u53f7\u4e00\u89a7\u3068\u5206\u5c90\u51e6\u7406\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Err.Number\u306e\u5024\u3092Select Case\u3067\u5206\u5c90\u3059\u308b\u3053\u3068\u3067\u3001\u30a8\u30e9\u30fc\u306e\u7a2e\u985e\u3054\u3068\u306b\u7570\u306a\u308b\u5bfe\u51e6\u304c\u3067\u304d\u307e\u3059\u3002\u300c\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u306a\u3089\u5225\u306e\u30d1\u30b9\u3092\u8a66\u3059\u300d\u300c\u30bc\u30ed\u9664\u7b97\u306a\u30890\u3092\u30bb\u30c3\u30c8\u3059\u308b\u300d\u306e\u3088\u3046\u306b\u3001\u30a8\u30e9\u30fc\u306b\u5fdc\u3058\u305f\u9069\u5207\u306a\u56de\u5fa9\u51e6\u7406\u304c\u66f8\u3051\u307e\u3059\u3002\u3088\u304f\u51fa\u4f1a\u3046VBA\u306e\u30a8\u30e9\u30fc\u756a\u53f7\u3092\u899a\u3048\u3066\u304a\u304f\u3068\u3001\u539f\u56e0\u7279\u5b9a\u304c\u901f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<table>\n<thead><tr><th>\u30a8\u30e9\u30fc\u756a\u53f7<\/th><th>\u30a8\u30e9\u30fc\u5185\u5bb9<\/th><th>\u5178\u578b\u7684\u306a\u539f\u56e0<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>11<\/td><td>Division by zero\uff08\u30bc\u30ed\u9664\u7b97\uff09<\/td><td>\u5206\u6bcd\u306e\u5024\u304c\u30bc\u30ed<\/td><\/tr>\n<tr><td>13<\/td><td>Type mismatch\uff08\u578b\u306e\u4e0d\u4e00\u81f4\uff09<\/td><td>\u6587\u5b57\u5217\u306e\u30bb\u30eb\u3092\u6570\u5024\u578b\u306e\u5909\u6570\u306b\u4ee3\u5165<\/td><\/tr>\n<tr><td>91<\/td><td>Object variable not set\uff08\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u672a\u8a2d\u5b9a\uff09<\/td><td>Set\u524d\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u3092\u4f7f\u7528<\/td><\/tr>\n<tr><td>1004<\/td><td>Application-defined or object-defined error<\/td><td>\u30b7\u30fc\u30c8\/\u30bb\u30eb\u64cd\u4f5c\u306e\u591a\u69d8\u306a\u30a8\u30e9\u30fc\uff08\u6700\u983b\u51fa\uff09<\/td><\/tr>\n<tr><td>53<\/td><td>File not found\uff08\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\uff09<\/td><td>\u6307\u5b9a\u30d1\u30b9\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044<\/td><\/tr>\n<tr><td>9<\/td><td>Subscript out of range\uff08\u6dfb\u5b57\u304c\u7bc4\u56f2\u5916\uff09<\/td><td>\u5b58\u5728\u3057\u306a\u3044\u914d\u5217\u8981\u7d20\u3084\u30b7\u30fc\u30c8\u3092\u53c2\u7167<\/td><\/tr>\n<tr><td>70<\/td><td>Permission denied\uff08\u30a2\u30af\u30bb\u30b9\u62d2\u5426\uff09<\/td><td>\u30d5\u30a1\u30a4\u30eb\u304c\u4ed6\u306e\u30a2\u30d7\u30ea\u3067\u958b\u304b\u308c\u3066\u3044\u308b<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30a8\u30e9\u30fc\u756a\u53f7\u3067Select Case\u5206\u5c90\u3059\u308b\u4f8b\nSub SmartErrorHandler()\n    On Error GoTo ErrorHandler\n\n    &#x27; === \u51e6\u7406 ===\n    Dim filePath As String\n    filePath = &quot;C:\\Data\\report.xlsx&quot;\n    Workbooks.Open filePath\n\n    Dim ws As Worksheet\n    Set ws = ThisWorkbook.Sheets(&quot;\u96c6\u8a08&quot;)\n\n    Dim result As Double\n    result = ws.Cells(5, 3).Value \/ ws.Cells(5, 4).Value\n    ws.Cells(5, 5).Value = result\n    Exit Sub\n\nErrorHandler:\n    Select Case Err.Number\n        Case 53  &#x27; \u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\n            MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: &quot; &amp; filePath &amp; vbCrLf &amp; _\n                   &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u6b63\u3057\u3044\u30d5\u30a9\u30eb\u30c0\u306b\u3042\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbCritical\n        Case 9   &#x27; \u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\n            MsgBox &quot;\u300c\u96c6\u8a08\u300d\u30b7\u30fc\u30c8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002&quot; &amp; vbCrLf &amp; _\n                   &quot;\u30b7\u30fc\u30c8\u540d\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbExclamation\n        Case 11  &#x27; \u30bc\u30ed\u9664\u7b97\n            ws.Cells(5, 5).Value = 0  &#x27; \u30bc\u30ed\u3067\u4e0a\u66f8\u304d\n            MsgBox &quot;\u30bc\u30ed\u9664\u7b97\u306e\u305f\u3081\u7d50\u679c\u30920\u306b\u3057\u307e\u3057\u305f&quot;, vbInformation\n            Resume Next  &#x27; \u6b21\u306e\u884c\u304b\u3089\u7d9a\u3051\u308b\n        Case 70  &#x27; \u30a2\u30af\u30bb\u30b9\u62d2\u5426\n            MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u4ed6\u306e\u30a2\u30d7\u30ea\u3067\u958b\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u9589\u3058\u3066\u304b\u3089\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbExclamation\n        Case Else\n            MsgBox &quot;\u4e88\u671f\u305b\u306c\u30a8\u30e9\u30fc\uff08No.&quot; &amp; Err.Number &amp; &quot;\uff09: &quot; &amp; Err.Description, vbCritical\n    End Select\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">ON ERROR GOTO 0<\/span>\n  <span class=\"section-title\" style=\"display:block;\">On Error GoTo 0\uff1a\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u7121\u52b9\u5316<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u6709\u52b9\u7bc4\u56f2\u3092\u5236\u5fa1\u3057\u3066\u8907\u6570\u7b87\u6240\u306b\u5bfe\u5fdc\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u300cOn Error GoTo 0\u300d\u306f\u3001\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u30a8\u30e9\u30fc\u51e6\u7406\uff08On Error GoTo \u307e\u305f\u306f On Error Resume Next\uff09\u3092\u7121\u52b9\u5316\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002\u3053\u306e\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3092\u66f8\u3044\u305f\u5f8c\u306f\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3068VBA\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u52d5\u4f5c\uff08\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u3066\u505c\u6b62\uff09\u306b\u623b\u308a\u307e\u3059\u3002On Error GoTo 0\u306f\u4e3b\u306b\u300cOn Error Resume Next\u306e\u9069\u7528\u7bc4\u56f2\u3092\u9650\u5b9a\u3059\u308b\u300d\u307e\u305f\u306f\u300c\u8907\u6570\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u6bb5\u968e\u7684\u306b\u4f7f\u3044\u5206\u3051\u308b\u300d\u76ee\u7684\u3067\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; On Error GoTo 0\u3067\u9069\u7528\u7bc4\u56f2\u3092\u9650\u5b9a\u3059\u308b\nSub ScopedErrorHandling()\n    &#x27; ===== \u30d5\u30a7\u30fc\u30ba1: \u30d5\u30a1\u30a4\u30eb\u5b58\u5728\u78ba\u8a8d\uff08\u30a8\u30e9\u30fc\u3092\u7121\u8996\u3057\u3066\u78ba\u8a8d\u306e\u307f\uff09 =====\n    Dim wb As Workbook\n    On Error Resume Next\n    Set wb = Workbooks.Open(&quot;C:\\Data\\optional.xlsx&quot;)\n    On Error GoTo 0  &#x27; \u2190 \u3053\u3053\u3067\u7121\u52b9\u5316\uff08\u3053\u308c\u4ee5\u964d\u306f\u901a\u5e38\u306e\u30a8\u30e9\u30fc\u691c\u77e5\u306b\u623b\u308b\uff09\n\n    If wb Is Nothing Then\n        MsgBox &quot;optional\u30d5\u30a1\u30a4\u30eb\u306a\u3057 - \u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059&quot;\n    Else\n        &#x27; ===== \u30d5\u30a7\u30fc\u30ba2: \u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3059\u308b\u5834\u5408\u306e\u51e6\u7406\uff08\u30a8\u30e9\u30fc\u306f\u3057\u3063\u304b\u308a\u691c\u77e5\uff09 =====\n        On Error GoTo ProcessError\n        Dim ws As Worksheet\n        Set ws = wb.Sheets(&quot;\u30ec\u30dd\u30fc\u30c8&quot;)  &#x27; \u3053\u3053\u3067\u30a8\u30e9\u30fc\u304c\u51fa\u305f\u3089ProcessError\u3078\n        &#x27; ... \u51e6\u7406 ...\n        wb.Close False\n        On Error GoTo 0  &#x27; \u51e6\u7406\u5b8c\u4e86\u5f8c\u306b\u7121\u52b9\u5316\n    End If\n    Exit Sub\n\nProcessError:\n    MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u51e6\u7406\u4e2d\u306b\u30a8\u30e9\u30fc: &quot; &amp; Err.Description, vbCritical\n    If Not wb Is Nothing Then wb.Close False\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;\">On Error GoTo 0\u3092\u66f8\u304d\u5fd8\u308c\u308b\u3068\u7bc4\u56f2\u5916\u306b\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u6f0f\u308c\u308b<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">On Error Resume Next\u3092\u66f8\u3044\u305f\u3089\u5fc5\u305aOn Error GoTo 0\u3067\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u2014\u2014\u3053\u308c\u304c\u9244\u5247\u3067\u3059\u3002On Error Resume Next\u3092\u66f8\u3044\u305f\u307e\u307e\u51e6\u7406\u304c\u9032\u3080\u3068\u3001\u610f\u56f3\u3057\u306a\u3044\u7b87\u6240\u306e\u30a8\u30e9\u30fc\u304c\u5168\u3066\u7121\u8996\u3055\u308c\u307e\u3059\u3002\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089\u3059\u3050\u306bOn Error GoTo 0\u3067\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u7fd2\u6163\u3092\u3064\u3051\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">BUSINESS PATTERNS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u696d\u52d9\u30de\u30af\u30ed\u3067\u306e\u5b9f\u8df5\u30a8\u30e9\u30fc\u51e6\u7406\u30d1\u30bf\u30fc\u30f3<\/span>\n  <span class=\"section-desc\">\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u30fb\u4e00\u62ec\u51e6\u7406\u30fb\u5916\u90e8\u63a5\u7d9a\u306e\u5178\u578b\u7684\u306a\u30a8\u30e9\u30fc\u5bfe\u51e6\u30b3\u30fc\u30c9<\/span>\n<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">8-1. \u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8<\/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; \u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u306e\u6a19\u6e96\u7684\u306a\u30a8\u30e9\u30fc\u51e6\u7406\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\nSub FileOperationTemplate()\n    Dim filePath As String\n    Dim wb As Workbook\n\n    filePath = &quot;C:\\Data\\monthly_report.xlsx&quot;\n\n    On Error GoTo ErrorHandler\n\n    &#x27; ===== \u524d\u51e6\u7406 =====\n    Application.ScreenUpdating = False  &#x27; \u753b\u9762\u66f4\u65b0\u505c\u6b62\uff08\u5f8c\u51e6\u7406\u3067\u5fc5\u305a\u623b\u3059\uff09\n\n    &#x27; ===== \u30e1\u30a4\u30f3\u51e6\u7406 =====\n    Set wb = Workbooks.Open(filePath, ReadOnly:=False)\n\n    &#x27; \u30c7\u30fc\u30bf\u51e6\u7406\n    wb.Sheets(1).Cells(1, 1).Value = &quot;\u51e6\u7406\u6e08&quot;\n    wb.Save\n    wb.Close\n\n    &#x27; ===== \u5f8c\u51e6\u7406\uff08\u6b63\u5e38\u5b8c\u4e86\uff09 =====\n    Application.ScreenUpdating = True\n    MsgBox &quot;\u51e6\u7406\u5b8c\u4e86: &quot; &amp; filePath, vbInformation\n    Exit Sub\n\n&#x27; ===== \u30a8\u30e9\u30fc\u51e6\u7406 =====\nErrorHandler:\n    Dim errNum As Long\n    Dim errDesc As String\n    errNum = Err.Number\n    errDesc = Err.Description\n\n    &#x27; \u5f8c\u51e6\u7406\uff08\u30a8\u30e9\u30fc\u3067\u3082\u5fc5\u305a\u5b9f\u884c\uff09\n    Application.ScreenUpdating = True\n    On Error Resume Next  &#x27; \u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u4e2d\u306e\u30a8\u30e9\u30fc\u306f\u7121\u8996\n    If Not wb Is Nothing Then wb.Close False  &#x27; \u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\n    On Error GoTo 0\n\n    &#x27; \u30e6\u30fc\u30b6\u30fc\u3078\u306e\u901a\u77e5\n    Select Case errNum\n        Case 53\n            MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: &quot; &amp; filePath, vbCritical\n        Case 70\n            MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u304c\u4ed6\u3067\u958b\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u9589\u3058\u3066\u304b\u3089\u518d\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbExclamation\n        Case 1004\n            MsgBox &quot;\u30d5\u30a1\u30a4\u30eb\u64cd\u4f5c\u30a8\u30e9\u30fc\uff08&quot; &amp; errNum &amp; &quot;\uff09: &quot; &amp; errDesc, vbCritical\n        Case Else\n            MsgBox &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\uff08&quot; &amp; errNum &amp; &quot;\uff09: &quot; &amp; errDesc, vbCritical\n    End Select\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\">\u696d\u52d9\u30de\u30af\u30ed\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u6700\u3082\u91cd\u8981\u306a\u306e\u306f\u300cApplication.ScreenUpdating\u3092\u5fc5\u305a\u623b\u3059\u300d\u300c\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u5fc5\u305a\u9589\u3058\u308b\u300d\u306e2\u70b9\u3067\u3059\u3002\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u3063\u3066ScreenUpdating\u304cFalse\u306e\u307e\u307e\u3060\u3068\u3001\u6b21\u306bExcel\u3092\u64cd\u4f5c\u3059\u308b\u3068\u304d\u753b\u9762\u304c\u56fa\u307e\u3063\u305f\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u3002ErrorHandler\u3067\u5fc5\u305a\u5f8c\u51e6\u7406\u3092\u884c\u3046\u7fd2\u6163\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8-2. \u30eb\u30fc\u30d7\u51e6\u7406\u3067\u306e\u30a8\u30e9\u30fc\u5bfe\u51e6\uff08\u884c\u5358\u4f4d\u306e\u30b9\u30ad\u30c3\u30d7\uff09<\/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; \u30eb\u30fc\u30d7\u5185\u3067\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u884c\u3060\u3051\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u3066\u7d99\u7d9a\nSub BulkProcessWithErrorHandling()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim errorCount As Long\n    errorCount = 0\n\n    Dim r As Long\n    For r = 2 To lastRow\n        On Error GoTo RowError  &#x27; \u2190 \u30eb\u30fc\u30d7\u306e\u4e2d\u3067On Error\u3092\u8a2d\u5b9a\u3057\u76f4\u3059\n\n        &#x27; \u51e6\u7406\uff08\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b\uff09\n        Dim divisor As Double\n        divisor = ws.Cells(r, 3).Value\n        ws.Cells(r, 4).Value = ws.Cells(r, 2).Value \/ divisor\n        ws.Cells(r, 5).Value = &quot;OK&quot;\n\n        GoTo NextRow  &#x27; \u2190 \u30a8\u30e9\u30fc\u306a\u3057 \u2192 ErrorHandler\u3092\u30b9\u30ad\u30c3\u30d7\nRowError:\n        ws.Cells(r, 5).Value = &quot;ERROR: &quot; &amp; Err.Description\n        errorCount = errorCount + 1\n        Err.Clear\nNextRow:\n    Next r\n\n    On Error GoTo 0  &#x27; \u30eb\u30fc\u30d7\u7d42\u4e86\u5f8c\u306b\u7121\u52b9\u5316\n\n    If errorCount &gt; 0 Then\n        MsgBox lastRow - 1 &amp; &quot;\u884c\u4e2d&quot; &amp; errorCount &amp; &quot;\u884c\u3067\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; _\n               &quot;E\u5217\u3067\u30a8\u30e9\u30fc\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044&quot;, vbExclamation\n    Else\n        MsgBox &quot;\u5168&quot; &amp; lastRow - 1 &amp; &quot;\u884c\u306e\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f&quot;, vbInformation\n    End If\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">COMMON MISTAKES<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u3088\u304f\u3042\u308b\u5931\u6557\u3068\u30c7\u30d0\u30c3\u30b0\u306e\u30b3\u30c4<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u66f8\u3044\u305f\u306e\u306b\u52d5\u304b\u306a\u3044\u5178\u578b\u7684\u306a\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5<\/span>\n<\/h2>\n\n\n\n<table>\n<thead><tr><th>\u3088\u304f\u3042\u308b\u5931\u6557<\/th><th>\u539f\u56e0<\/th><th>\u5bfe\u51e6\u6cd5<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u52d5\u304b\u306a\u3044<\/td><td>On Error GoTo \u30e9\u30d9\u30eb\u306e\u30e9\u30d9\u30eb\u540d\u304c\u4e00\u81f4\u3057\u306a\u3044<\/td><td>\u30e9\u30d9\u30eb\u540d\u3068On Error GoTo\u306e\u540d\u524d\u3092\u5b8c\u5168\u4e00\u81f4\u3055\u305b\u308b<\/td><\/tr>\n<tr><td>Exit Sub\u3092\u66f8\u3044\u305f\u306e\u306bErrorHandler\u304c\u5b9f\u884c\u3055\u308c\u308b<\/td><td>Exit Sub\u304c\u30a8\u30e9\u30fc\u51e6\u7406\u30d6\u30ed\u30c3\u30af\u306e\u5185\u5074\u306b\u66f8\u304b\u308c\u3066\u3044\u308b<\/td><td>Exit Sub\u306fErrorHandler:\u30e9\u30d9\u30eb\u306e\u76f4\u524d\uff08\u5916\u5074\uff09\u306b\u66f8\u304f<\/td><\/tr>\n<tr><td>On Error Resume Next\u306e\u5f8c\u3082\u30a8\u30e9\u30fc\u3067\u6b62\u307e\u308b<\/td><td>Err.Clear\u3092\u5fd8\u308c\u3066\u30a8\u30e9\u30fc\u72b6\u614b\u304c\u6b8b\u3063\u3066\u3044\u308b<\/td><td>\u30a8\u30e9\u30fc\u78ba\u8a8d\u5f8c\u306bErr.Clear()\u3092\u547c\u3076<\/td><\/tr>\n<tr><td>\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u306e\u306bErr.Number = 0<\/td><td>Err.Clear\u304c\u5148\u306b\u547c\u3070\u308c\u305f\u30fb\u30a8\u30e9\u30fc\u51e6\u7406\u5185\u3067\u5225\u306eOn Error\u3092\u4f7f\u3063\u305f<\/td><td>Err.Number\u306f\u30a8\u30e9\u30fc\u767a\u751f\u5f8c\u3059\u3050\u306b\u5909\u6570\u306b\u4fdd\u5b58\u3059\u308b<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\">9-1. \u30c7\u30d0\u30c3\u30b0\u306e\u5b9f\u8df5\u30c6\u30af\u30cb\u30c3\u30af<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u30c7\u30d0\u30c3\u30b0\u3067\u5f79\u7acb\u3064\u30c6\u30af\u30cb\u30c3\u30af\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Debug.Print\u3067\u5b9f\u884c\u72b6\u6cc1\u3092\u8a18\u9332<\/strong>\uff1aErrorHandler\u5185\u3067Debug.Print Err.Number & \" - \" & Err.Description\u3092\u8ffd\u52a0\u3057\u3001\u30a4\u30df\u30c7\u30a3\u30a8\u30a4\u30c8\u30a6\u30a3\u30f3\u30c9\u30a6\uff08Ctrl+G\uff09\u3067\u78ba\u8a8d\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a<\/strong>\uff1a\u30a8\u30e9\u30fc\u304c\u51fa\u305d\u3046\u306a\u884c\u306e\u5de6\u7aef\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\uff08\u8d64\u4e38\uff09\u3092\u8a2d\u5b9a\u3057\u30011\u884c\u305a\u3064\u5b9f\u884c\u3057\u3066\u5909\u6570\u306e\u5024\u3092\u78ba\u8a8d<\/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>Err.Number\u306e\u5024\u3092MsgBox\u3067\u78ba\u8a8d<\/strong>\uff1aErrorHandler\u5192\u982d\u3067MsgBox \"ErrNo: \" & Err.Number\u3092\u5165\u308c\u3001\u4f55\u756a\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b\u304b\u7279\u5b9a\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30a8\u30e9\u30fc\u5f8c\u306e\u5909\u6570\u3092\u78ba\u8a8d<\/strong>\uff1aErrorHandler\u5185\u3067Debug.Print \"wb is Nothing: \" & (wb Is Nothing)\u306e\u3088\u3046\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5909\u6570\u306e\u72b6\u614b\u3092\u78ba\u8a8d<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u30c7\u30d0\u30c3\u30b0\u3067\u4e00\u756a\u4f7f\u3048\u308b\u306e\u306f\u300cErrorHandler\u306e\u6700\u521d\u306bMsgBox Err.Number & \" \" & Err.Description\u3092\u5165\u308c\u308b\u300d\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u3060\u3051\u3067\u4f55\u756a\u306e\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b\u304b\u304c\u5206\u304b\u308a\u3001\u5bfe\u51e6\u65b9\u91dd\u304c\u7acb\u3066\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u672c\u756a\u524d\u306b\u5916\u305b\u3070OK\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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;\">CLAUDE CODE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Claude Code\u3067VBA\u30a8\u30e9\u30fc\u51e6\u7406\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210<\/span>\n  <span class=\"section-desc\">\u30a8\u30e9\u30fc\u51e6\u7406\u30b3\u30fc\u30c9\u306e\u751f\u6210\u30fb\u30c7\u30d0\u30c3\u30b0\u30fb\u6539\u5584\u3092AI\u306b\u4efb\u305b\u308b\u65b9\u6cd5<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u306f\u300c\u3069\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u5f97\u308b\u304b\u300d\u300c\u3069\u3046\u5bfe\u51e6\u3059\u308b\u304b\u300d\u306e\u5224\u65ad\u304c\u96e3\u3057\u304f\u3001\u696d\u52d9\u30de\u30af\u30ed\u3092\u5805\u7262\u306b\u3059\u308b\u305f\u3081\u306b\u7d4c\u9a13\u3068\u77e5\u8b58\u304c\u5fc5\u8981\u3067\u3059\u3002Claude Code\u3092\u4f7f\u3046\u3068\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3044\u3066\u51e6\u7406\u3059\u308b\u30de\u30af\u30ed\u306b\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u3066\u300d\u3068\u4f9d\u983c\u3059\u308b\u3060\u3051\u3067\u3001On Error GoTo\u30d1\u30bf\u30fc\u30f3\u30fbErr\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6d3b\u7528\u30fb\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\u3092\u542b\u3080\u5805\u7262\u306a\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u8ffd\u52a0\u4f9d\u983c<\/strong>\uff1a\u300c\u3053\u306eVBA\u30b3\u30fc\u30c9\u306b\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u3066\u3002\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u3068\u30b7\u30fc\u30c8\u304c\u5b58\u5728\u3057\u306a\u3044\u5834\u5408\u306f\u500b\u5225\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u3057\u3066\u300d<\/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>\u30a8\u30e9\u30fc\u756a\u53f7\u304b\u3089\u539f\u56e0\u8abf\u67fb<\/strong>\uff1a\u300cVBA\u30a8\u30e9\u30fc1004\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u539f\u56e0\u3068\u5bfe\u51e6\u6cd5\u3092\u6559\u3048\u3066\u300d<\/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>\u30a8\u30e9\u30fc\u30ed\u30b0\u6a5f\u80fd\u306e\u8ffd\u52a0<\/strong>\uff1a\u300c\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3068\u304d\u306b\u65e5\u6642\u30fb\u30a8\u30e9\u30fc\u756a\u53f7\u30fb\u8aac\u660e\u3092\u30b7\u30fc\u30c8\u306b\u8a18\u9332\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u300d<\/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>\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0<\/strong>\uff1a\u300c\u3053\u306e\u30de\u30af\u30ed\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u6539\u5584\u3057\u3066\u3002On Error Resume Next\u3092\u4f7f\u3044\u3059\u304e\u3066\u3044\u308b\u306e\u3092\u4fee\u6b63\u3057\u3066\u300d<\/span><\/div>\n\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\">\u5f0a\u793e\u3067\u306f\u8907\u96d1\u306aExcel\u696d\u52d9\u30de\u30af\u30ed\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u8a2d\u8a08\u3092Claude Code\u306b\u4efb\u305b\u3066\u3044\u307e\u3059\u3002\u300c\u3053\u306e\u30de\u30af\u30ed\u3067\u767a\u751f\u3057\u5f97\u308b\u30a8\u30e9\u30fc\u3092\u5217\u6319\u3057\u3066\u3001\u305d\u308c\u305e\u308c\u3078\u306e\u5bfe\u51e6\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u300d\u3068\u4f9d\u983c\u3059\u308b\u3068\u3001\u7d4c\u9a13\u8c4a\u5bcc\u306a\u30a8\u30f3\u30b8\u30cb\u30a2\u304c\u8a2d\u8a08\u3057\u305f\u3088\u3046\u306a\u5805\u7262\u306a\u30a8\u30e9\u30fc\u51e6\u7406\u304c\u5b9f\u88c5\u3055\u308c\u307e\u3059\u3002\u7279\u306bOn Error GoTo 0\u3068On Error Resume Next\u306e\u4f7f\u3044\u5206\u3051\u3092\u6b63\u78ba\u306b\u5224\u65ad\u3057\u3066\u304f\u308c\u308b\u70b9\u304c\u512a\u79c0\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-error-handling-2&#038;blog_slug=cc-vba-error-handling-2\" 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-error-handling-2&#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-11\"><\/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;\">11<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CONCLUSION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u307e\u3068\u3081<\/span>\n  <span class=\"section-desc\">VBA\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u5168\u4f53\u50cf\u3068\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u309211\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u4f53\u7cfb\u7684\u306b\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002On Error GoTo\u30fbResume\u30fbErr\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u30fbSelect Case\u5206\u5c90\u30fb\u696d\u52d9\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\u307e\u3067\u3001\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u5168\u4f53\u50cf\u3092\u7db2\u7f85\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30a8\u30e9\u30fc\u306e3\u7a2e\u985e<\/strong>\uff1a\u30b3\u30f3\u30d1\u30a4\u30eb\u30fb\u5b9f\u884c\u6642\u30fb\u8ad6\u7406\u306e\u9055\u3044\u3092\u7406\u89e3\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>On Error GoTo \u30e9\u30d9\u30eb<\/strong>\uff1a\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3002\u5fc5\u305aExit Sub\u3068\u5bfe\u306b\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>On Error Resume Next<\/strong>\uff1a\u9069\u7528\u7bc4\u56f2\u3092\u9650\u5b9a\u3057\u3001\u4f7f\u5f8c\u3059\u3050On Error GoTo 0\u3067\u30ea\u30bb\u30c3\u30c8<\/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>Resume\u7cfb<\/strong>\uff1aResume\uff08\u540c\u884c\u518d\u5b9f\u884c\uff09\u30fbResume Next\uff08\u6b21\u884c\u3078\uff09\u30fbResume \u30e9\u30d9\u30eb\uff08\u6307\u5b9a\u4f4d\u7f6e\u3078\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff1aNumber\u30fbDescription\u30fbSource\u3067\u30a8\u30e9\u30fc\u3092\u7279\u5b9a\u3057\u3066\u30ed\u30b0\u306b\u8a18\u9332<\/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>\u5f8c\u51e6\u7406\u306e\u5fb9\u5e95<\/strong>\uff1aScreenUpdating\u30fb\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb\u30fb\u958b\u653e\u3059\u3079\u304d\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fErrorHandler\u3067\u3082\u5fc5\u305a\u51e6\u7406<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u30a8\u30e9\u30fc\u51e6\u7406\u306f\u300c\u66f8\u304f\u306e\u304c\u9762\u5012\u300d\u3068\u5f8c\u56de\u3057\u306b\u3055\u308c\u304c\u3061\u3067\u3059\u304c\u3001\u696d\u52d9\u3067\u4ed6\u8005\u306b\u4f7f\u3063\u3066\u3082\u3089\u3046\u30de\u30af\u30ed\u3067\u306f\u5fc5\u9808\u3067\u3059\u3002On Error GoTo\u306e\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u624b\u5143\u306b\u6301\u3061\u3001\u30de\u30af\u30ed\u3092\u66f8\u304f\u305f\u3073\u306b\u9069\u7528\u3059\u308b\u7fd2\u6163\u3092\u3064\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">VBA\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u8a2d\u8a08\u304b\u3089\u5b9f\u88c5\u307e\u3067\u3001Claude Code\u3067\u5373\u89e3\u6c7a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30de\u30af\u30ed\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u3069\u3046\u66f8\u3051\u3070\u3044\u3044\u304b\u5206\u304b\u3089\u306a\u3044\u300d\u300c\u672c\u756a\u306e\u30de\u30af\u30ed\u304c\u7a81\u7136\u6b62\u307e\u3063\u3066\u56f0\u3063\u3066\u3044\u308b\u300d\u300c\u30a8\u30e9\u30fc\u30ed\u30b0\u306e\u4ed5\u7d44\u307f\u3092\u6574\u5099\u3057\u305f\u3044\u300d\u2014\u2014\u5f0a\u793eAI\u9b3c\u7ba1\u7406\u3067\u306f\u3001Claude Code\u3092\u6d3b\u7528\u3057\u305f\u696d\u52d9VBA\u30de\u30af\u30ed\u306e\u5805\u7262\u5316\u30fb\u81ea\u52d5\u5316\u652f\u63f4\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u9069\u5207\u306b\u8a2d\u8a08\u3059\u308b\u3060\u3051\u3067\u3001\u30de\u30af\u30ed\u306e\u4fe1\u983c\u6027\u3068\u4fdd\u5b88\u6027\u304c\u5927\u5e45\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002\u307e\u305a\u306f\u7121\u6599\u76f8\u8ac7\u3067\u3001\u73fe\u72b6\u306e\u30de\u30af\u30ed\u306e\u8ab2\u984c\u3092\u304a\u805e\u304b\u305b\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-error-handling&utm_content=next-step-cta\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#dc2626;color:#fff;font-weight:700;font-size:15px;padding:14px 32px;border-radius:30px;text-decoration:none;\">AI\u9b3c\u7ba1\u7406\u3092\u8a73\u3057\u304f\u898b\u308b \u2192<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. On Error GoTo\u3068On Error Resume Next\u306e\u4f7f\u3044\u5206\u3051\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. On Error GoTo\u306f\u300c\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u5c02\u7528\u306e\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u306b\u98db\u3076\u300d\u2014\u2014\u30a8\u30e9\u30fc\u3054\u3068\u306b\u7570\u306a\u308b\u51e6\u7406\u304c\u5fc5\u8981\u3001\u5f8c\u51e6\u7406\uff08\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u306a\u3069\uff09\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002On Error Resume Next\u306f\u300c\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3082\u7121\u8996\u3057\u3066\u6b21\u306e\u884c\u3078\u9032\u3080\u300d\u2014\u2014\u30a8\u30e9\u30fc\u304c\u3042\u3063\u3066\u3082\u7d9a\u3051\u305f\u3044\u30eb\u30fc\u30d7\u51e6\u7406\u30fb\u5b58\u5728\u78ba\u8a8d\u30fb\u4efb\u610f\u51e6\u7406\u306e\u7279\u5b9a\u884c\u3067\u306e\u307f\u4f7f\u3044\u307e\u3059\u3002\u57fa\u672c\u306fOn Error GoTo\u3067\u3001On Error Resume Next\u306f\u9069\u7528\u7bc4\u56f2\u3092\u6700\u5c0f\u9650\u306b\u9650\u5b9a\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Exit Sub\u3068Exit Function\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u306a\u305c\u5fc5\u8981\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. On Error GoTo \u30e9\u30d9\u30eb\u3092\u4f7f\u3046\u5834\u5408\u3001\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u306a\u304b\u3063\u305f\u3068\u304d\u306b\u51e6\u7406\u304c\u6b63\u5e38\u7d42\u4e86\u3057\u305f\u5f8c\u3001\u305d\u306e\u307e\u307eErrorHandler\u30e9\u30d9\u30eb\u307e\u3067\u300c\u6d41\u308c\u8fbc\u3080\u300d\u306e\u3092\u9632\u3050\u305f\u3081\u306b\u5fc5\u8981\u3067\u3059\u3002Exit Sub\uff08\u307e\u305f\u306fExit Function\uff09\u3092ErrorHandler\u30e9\u30d9\u30eb\u306e\u76f4\u524d\u306b\u66f8\u304f\u3053\u3068\u3067\u3001\u6b63\u5e38\u7d42\u4e86\u3057\u305f\u5834\u5408\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5b8c\u5168\u306b\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Err.Clear\u306f\u4f55\u306e\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066Err.Number\u306b\u756a\u53f7\u304c\u5165\u3063\u305f\u5f8c\u3001\u6b21\u306e\u30a8\u30e9\u30fc\u78ba\u8a8d\u304c\u6b63\u78ba\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002\u7279\u306bOn Error Resume Next\u3092\u4f7f\u3063\u3066\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3057\u305f\u5f8c\u306f\u3001Err.Clear()\u3092\u547c\u3070\u306a\u3044\u3068\u524d\u306e\u30a8\u30e9\u30fc\u60c5\u5831\u304c\u6b8b\u3063\u305f\u307e\u307e\u6b21\u306e\u51e6\u7406\u306b\u9032\u307f\u307e\u3059\u3002If Err.Number <> 0 Then ... Err.Clear End If\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u30eb\u30fc\u30d7\u5185\u3067On Error GoTo\u3092\u4f7f\u3046\u5834\u5408\u306e\u6ce8\u610f\u70b9\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u30eb\u30fc\u30d7\u5185\u3067On Error GoTo\u3092\u4f7f\u3046\u5834\u5408\u3001On Error GoTo \u30e9\u30d9\u30eb\u306f\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u7e70\u308a\u8fd4\u3057\u6709\u52b9\u5316\u3067\u304d\u307e\u3059\uff08VBA\u306eOn Error GoTo\u306f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u30b9\u30b3\u30fc\u30d7\u306e\u305f\u3081\uff09\u3002\u305f\u3060\u3057\u300cResume Next\u3067\u30eb\u30fc\u30d7\u306e\u6b21\u306e\u53cd\u5fa9\u306b\u623b\u308b\u300d\u300cGoTo NextRow\u306e\u3088\u3046\u306a\u30e9\u30d9\u30eb\u3092\u4f7f\u3046\u300d\u3068\u3044\u3063\u305f\u30d1\u30bf\u30fc\u30f3\u3067\u660e\u793a\u7684\u306b\u6b21\u306e\u884c\/\u6b21\u306e\u53cd\u5fa9\u306b\u79fb\u52d5\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. On Error GoTo -1\u3068On Error GoTo 0\u306e\u9055\u3044\u306f\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. On Error GoTo 0\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u30cf\u30f3\u30c9\u30e9\u3092\u7121\u52b9\u5316\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002On Error GoTo -1\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u300c\u30a8\u30e9\u30fc\u30b9\u30c6\u30fc\u30bf\u30b9\uff08\u4fdd\u7559\u4e2d\u306e\u30a8\u30e9\u30fc\uff09\u300d\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30e9\u5185\u30672\u91cd\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002\u901a\u5e38\u306e\u696d\u52d9\u30de\u30af\u30ed\u3067\u306fOn Error GoTo 0\u3092\u4f7f\u3048\u3070\u5341\u5206\u3067\u3001On Error GoTo -1\u304c\u5fc5\u8981\u306a\u30b1\u30fc\u30b9\u306f\u307e\u308c\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. VBA\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u30b3\u30c4\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. ErrorHandler\u306e\u5192\u982d\u306bMsgBox Err.Number & \": \" & Err.Description\u3068Debug.Print\u3092\u4e21\u65b9\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u300c\u3069\u3093\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b\u304b\u300d\u304c\u5373\u5ea7\u306b\u5206\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\uff08\u884c\u982d\u30af\u30ea\u30c3\u30af\u2192\u8d64\u4e38\uff09\u3092\u8a2d\u5b9a\u3057\u3066F8\u30ad\u30fc\u30671\u884c\u305a\u3064\u5b9f\u884c\u3059\u308b\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u306f\u3001\u30a8\u30e9\u30fc\u306e\u767a\u751f\u7b87\u6240\u306e\u7279\u5b9a\u306b\u6700\u3082\u52b9\u679c\u7684\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\": \"On Error GoTo\u3068On Error Resume Next\u306e\u4f7f\u3044\u5206\u3051\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"On Error GoTo\u306f\u300c\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u5c02\u7528\u306e\u51e6\u7406\u30eb\u30fc\u30c6\u30a3\u30f3\u306b\u98db\u3076\u300d\u2014\u2014\u30a8\u30e9\u30fc\u3054\u3068\u306b\u7570\u306a\u308b\u51e6\u7406\u304c\u5fc5\u8981\u3001\u5f8c\u51e6\u7406\uff08\u30d5\u30a1\u30a4\u30eb\u3092\u9589\u3058\u308b\u306a\u3069\uff09\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002On Error Resume Next\u306f\u300c\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3082\u7121\u8996\u3057\u3066\u6b21\u306e\u884c\u3078\u9032\u3080\u300d\u2014\u2014\u30a8\u30e9\u30fc\u304c\u3042\u3063\u3066\u3082\u7d9a\u3051\u305f\u3044\u30eb\u30fc\u30d7\u51e6\u7406\u30fb\u5b58\u5728\u78ba\u8a8d\u30fb\u4efb\u610f\u51e6\u7406\u306e\u7279\u5b9a\u884c\u3067\u306e\u307f\u4f7f\u3044\u307e\u3059\u3002\u57fa\u672c\u306fOn Error GoTo\u3067\u3001On Error Resume Next\u306f\u9069\u7528\u7bc4\u56f2\u3092\u6700\u5c0f\u9650\u306b\u9650\u5b9a\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Exit Sub\u3068Exit Function\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u306a\u305c\u5fc5\u8981\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"On Error GoTo \u30e9\u30d9\u30eb\u3092\u4f7f\u3046\u5834\u5408\u3001\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u306a\u304b\u3063\u305f\u3068\u304d\u306b\u51e6\u7406\u304c\u6b63\u5e38\u7d42\u4e86\u3057\u305f\u5f8c\u3001\u305d\u306e\u307e\u307eErrorHandler\u30e9\u30d9\u30eb\u307e\u3067\u300c\u6d41\u308c\u8fbc\u3080\u300d\u306e\u3092\u9632\u3050\u305f\u3081\u306b\u5fc5\u8981\u3067\u3059\u3002Exit Sub\uff08\u307e\u305f\u306fExit Function\uff09\u3092ErrorHandler\u30e9\u30d9\u30eb\u306e\u76f4\u524d\u306b\u66f8\u304f\u3053\u3068\u3067\u3001\u6b63\u5e38\u7d42\u4e86\u3057\u305f\u5834\u5408\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5b8c\u5168\u306b\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Err.Clear\u306f\u4f55\u306e\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3066Err.Number\u306b\u756a\u53f7\u304c\u5165\u3063\u305f\u5f8c\u3001\u6b21\u306e\u30a8\u30e9\u30fc\u78ba\u8a8d\u304c\u6b63\u78ba\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002\u7279\u306bOn Error Resume Next\u3092\u4f7f\u3063\u3066\u30a8\u30e9\u30fc\u3092\u78ba\u8a8d\u3057\u305f\u5f8c\u306f\u3001Err.Clear()\u3092\u547c\u3070\u306a\u3044\u3068\u524d\u306e\u30a8\u30e9\u30fc\u60c5\u5831\u304c\u6b8b\u3063\u305f\u307e\u307e\u6b21\u306e\u51e6\u7406\u306b\u9032\u307f\u307e\u3059\u3002If Err.Number <> 0 Then ... Err.Clear End If\u306e\u30d1\u30bf\u30fc\u30f3\u3067\u4f7f\u3044\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u30eb\u30fc\u30d7\u5185\u3067On Error GoTo\u3092\u4f7f\u3046\u5834\u5408\u306e\u6ce8\u610f\u70b9\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u30eb\u30fc\u30d7\u5185\u3067On Error GoTo\u3092\u4f7f\u3046\u5834\u5408\u3001On Error GoTo \u30e9\u30d9\u30eb\u306f\u30eb\u30fc\u30d7\u306e\u4e2d\u3067\u7e70\u308a\u8fd4\u3057\u6709\u52b9\u5316\u3067\u304d\u307e\u3059\uff08VBA\u306eOn Error GoTo\u306f\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u30b9\u30b3\u30fc\u30d7\u306e\u305f\u3081\uff09\u3002\u305f\u3060\u3057\u300cResume Next\u3067\u30eb\u30fc\u30d7\u306e\u6b21\u306e\u53cd\u5fa9\u306b\u623b\u308b\u300d\u300cGoTo NextRow\u306e\u3088\u3046\u306a\u30e9\u30d9\u30eb\u3092\u4f7f\u3046\u300d\u3068\u3044\u3063\u305f\u30d1\u30bf\u30fc\u30f3\u3067\u660e\u793a\u7684\u306b\u6b21\u306e\u884c\/\u6b21\u306e\u53cd\u5fa9\u306b\u79fb\u52d5\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"On Error GoTo -1\u3068On Error GoTo 0\u306e\u9055\u3044\u306f\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"On Error GoTo 0\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u30cf\u30f3\u30c9\u30e9\u3092\u7121\u52b9\u5316\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3059\u3002On Error GoTo -1\u306f\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u300c\u30a8\u30e9\u30fc\u30b9\u30c6\u30fc\u30bf\u30b9\uff08\u4fdd\u7559\u4e2d\u306e\u30a8\u30e9\u30fc\uff09\u300d\u3092\u30ea\u30bb\u30c3\u30c8\u3059\u308b\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u3001\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30e9\u5185\u30672\u91cd\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002\u901a\u5e38\u306e\u696d\u52d9\u30de\u30af\u30ed\u3067\u306fOn Error GoTo 0\u3092\u4f7f\u3048\u3070\u5341\u5206\u3067\u3001On Error GoTo -1\u304c\u5fc5\u8981\u306a\u30b1\u30fc\u30b9\u306f\u307e\u308c\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"VBA\u30a8\u30e9\u30fc\u51e6\u7406\u3067\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u30b3\u30c4\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"ErrorHandler\u306e\u5192\u982d\u306bMsgBox Err.Number & \\\": \\\" & Err.Description\u3068Debug.Print\u3092\u4e21\u65b9\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u300c\u3069\u3093\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u3044\u308b\u304b\u300d\u304c\u5373\u5ea7\u306b\u5206\u304b\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\uff08\u884c\u982d\u30af\u30ea\u30c3\u30af\u2192\u8d64\u4e38\uff09\u3092\u8a2d\u5b9a\u3057\u3066F8\u30ad\u30fc\u30671\u884c\u305a\u3064\u5b9f\u884c\u3059\u308b\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u306f\u3001\u30a8\u30e9\u30fc\u306e\u767a\u751f\u7b87\u6240\u306e\u7279\u5b9a\u306b\u6700\u3082\u52b9\u679c\u7684\u3067\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"<p>VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5b8c\u5168\u89e3\u8aac\u3002On Error GoTo\u30fbOn Error Resume Next\u30fbResume\u30fbGoTo\u30fbErr\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Number\/Description\/Source\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b9f\u8df5\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002\u696d\u52d9\u30de\u30af\u30ed\u306e\u30c7\u30d0\u30c3\u30b0\u306b\u5fc5\u9808\u306e\u77e5\u8b58\u3092\u7db2\u7f85\u3002<\/p>\n","protected":false},"author":1,"featured_media":18359,"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\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u3092\u5b8c\u5168\u89e3\u8aac\u3002On Error GoTo\u30fbOn Error Resume Next\u30fbResume\u30fbGoTo\u30fbErr\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Number\/Description\/Source\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b9f\u8df5\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002\u696d\u52d9\u30de\u30af\u30ed\u306e\u30c7\u30d0\u30c3\u30b0\u306b\u5fc5\u9808\u306e\u77e5\u8b58\u3092\u7db2\u7f85\u3002","rank_math_focus_keyword":"VBA \u30a8\u30e9\u30fc\u51e6\u7406","rank_math_title":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u30a8\u30e9\u30fc\u51e6\u7406\u5b8c\u5168\u30ac\u30a4\u30c9\uff5cOn Error\u30fbResume\u30fbGoTo\u306e\u4f7f\u3044\u65b9\u3068Err\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6d3b\u7528\u6cd5","pending_rewrite_html":"","pending_rewrite_id":"","pending_rewrite_kw":"","pending_rewrite_at":"","pending_rewrite_source":"","pending_rewrite_brief":"","pending_rewrite_evidence":"","approved_rewrite_html":"","approved_rewrite_id":"","approved_rewrite_kw":"","approved_rewrite_at":"","approved_rewrite_by":"","approved_rewrite_brief":"","approved_rewrite_evidence":"","rewrite_tracker_baseline":"","rewrite_tracker_7day":"","rewrite_tracker_14day":"","rewrite_tracker_30day":"","rewrite_tracker_notified":""},"categories":[3],"tags":[],"class_list":["post-18360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18360","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=18360"}],"version-history":[{"count":1,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18360\/revisions"}],"predecessor-version":[{"id":18361,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18360\/revisions\/18361"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/18359"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=18360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=18360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=18360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}