{"id":662,"date":"2025-06-01T04:49:09","date_gmt":"2025-05-31T19:49:09","guid":{"rendered":"https:\/\/hajidai.com\/excel\/2025\/06\/excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81vba%e3%82%b3%e3%83%bc%e3%83%89%e9%9d%99%e7%9a%84%e8%a7%a3%e6%9e%90%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9\/"},"modified":"2025-06-01T04:49:09","modified_gmt":"2025-05-31T19:49:09","slug":"excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81vba%e3%82%b3%e3%83%bc%e3%83%89%e9%9d%99%e7%9a%84%e8%a7%a3%e6%9e%90%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9","status":"publish","type":"post","link":"https:\/\/hajidai.com\/excel\/2025\/06\/excel%e4%b8%8a%e7%b4%9a%e8%80%85%e5%bf%85%e8%a6%8b%ef%bc%81vba%e3%82%b3%e3%83%bc%e3%83%89%e9%9d%99%e7%9a%84%e8%a7%a3%e6%9e%90%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%81%a7%e6%a5%ad%e5%8b%99%e5%8a%b9\/","title":{"rendered":"Excel\u4e0a\u7d1a\u8005\u5fc5\u898b\uff01VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u3067\u696d\u52d9\u52b9\u7387\u5316\u3068\u30b3\u30fc\u30c9\u54c1\u8cea\u5411\u4e0a\u3092\u5b9f\u73fe\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<h2>\u4e0a\u7d1a\u8005\u5411\u3051\uff1aExcel\u30de\u30af\u30ed\u3067\u696d\u52d9\u52b9\u7387\u5316\uff01VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u69cb\u7bc9\u306e\u30dd\u30a4\u30f3\u30c8<\/h2>\n<p>\u307e\u305a\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4e0a\u7d1a\u8005\u306e\u65b9\u306b\u3001\u3059\u3050\u306b\u8a66\u305b\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff1a<\/p>\n<p>&#8220;`vba<br \/>\nSub \u91cd\u8907\u524a\u9664\u3068\u4e26\u3079\u66ff\u3048()<br \/>\n    ActiveSheet.Range(&#8220;A:A&#8221;).RemoveDuplicates Columns:=1, Header:=xlYes<br \/>\n    ActiveSheet.Range(&#8220;A:A&#8221;).Sort Key1:=Range(&#8220;A1&#8221;), Order1:=xlAscending, Header:=xlYes<br \/>\nEnd Sub<br \/>\n&#8220;`<br \/>\n\u3053\u306e\u30de\u30af\u30ed\u306f\u3001A\u5217\u306e\u91cd\u8907\u3092\u524a\u9664\u3057\u3001\u6607\u9806\u306b\u4e26\u3079\u66ff\u3048\u3092\u884c\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u306e\u57fa\u672c\u7684\u306a\u4f5c\u696d\u3092\u4e00\u77ac\u3067\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>1. VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u306e\u91cd\u8981\u6027<\/h3>\n<p>Excel\u30de\u30af\u30ed\u3092\u6d3b\u7528\u3059\u308b\u4e0a\u7d1a\u8005\u306b\u3068\u3063\u3066\u3001VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u306e\u69cb\u7bc9\u306f\u975e\u5e38\u306b\u91cd\u8981\u3067\u3059\u3002\u9759\u7684\u89e3\u6790\u3068\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u305b\u305a\u306b\u30b3\u30fc\u30c9\u3092\u5206\u6790\u3059\u308b\u6280\u8853\u306e\u3053\u3068\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u6f5c\u5728\u7684\u306a\u30d0\u30b0\u3084\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u554f\u984c\u3092\u4e8b\u524d\u306b\u767a\u898b\u3057\u3001\u30b3\u30fc\u30c9\u306e\u54c1\u8cea\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Excel\u30de\u30af\u30ed\u306e\u958b\u767a\u3067\u306f\u3001\u3057\u3070\u3057\u3070\u8907\u96d1\u306aVBA\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u9759\u7684\u89e3\u6790\u3092\u884c\u3046\u3053\u3068\u3067\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\uff1a<\/p>\n<p>1. \u30b3\u30fc\u30c9\u306e\u4e00\u8cab\u6027\u7dad\u6301<br \/>\n2. \u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u306e\u4f4e\u6e1b<br \/>\n3. \u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/p>\n<h3>2. \u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u306e\u69cb\u7bc9\u30b9\u30c6\u30c3\u30d7<\/h3>\n<p>VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u8e0f\u3080\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\uff1a<\/p>\n<p>1. \u89e3\u6790\u30eb\u30fc\u30eb\u306e\u5b9a\u7fa9\uff1a\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u898f\u7d04\u3084 best practices \u3092\u660e\u78ba\u306b\u3057\u307e\u3059\u3002<br \/>\n2. \u89e3\u6790\u30c4\u30fc\u30eb\u306e\u9078\u629e\uff1aVBA\u306b\u5bfe\u5fdc\u3057\u305f\u9759\u7684\u89e3\u6790\u30c4\u30fc\u30eb\u3092\u9078\u3073\u307e\u3059\uff08\u4f8b\uff1aRubberduck VBA\uff09\u3002<br \/>\n3. \u89e3\u6790\u30d7\u30ed\u30bb\u30b9\u306e\u81ea\u52d5\u5316\uff1aCI\/CD\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\uff08\u6ce8\uff1a\u7d99\u7d9a\u7684\u30a4\u30f3\u30c6\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\/\u30c7\u30ea\u30d0\u30ea\u30fc\uff09\u306b\u7d44\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u30b9\u30c6\u30c3\u30d7\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001Excel\u30de\u30af\u30ed\u306e\u54c1\u8cea\u7ba1\u7406\u3092\u52b9\u7387\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>3. \u89e3\u6790\u7d50\u679c\u306e\u6d3b\u7528\u3068\u6539\u5584\u30b5\u30a4\u30af\u30eb<\/h3>\n<p>\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u3092\u69cb\u7bc9\u3057\u305f\u3089\u3001\u305d\u306e\u7d50\u679c\u3092\u52b9\u679c\u7684\u306b\u6d3b\u7528\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\uff1a<\/p>\n<p>1. \u5b9a\u671f\u7684\u306a\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\uff1a\u89e3\u6790\u7d50\u679c\u3092\u57fa\u306b\u30c1\u30fc\u30e0\u5185\u3067\u30b3\u30fc\u30c9\u30ec\u30d3\u30e5\u30fc\u3092\u5b9f\u65bd\u3057\u307e\u3059\u3002<br \/>\n2. \u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\uff1a\u691c\u51fa\u3055\u308c\u305f\u554f\u984c\u7b87\u6240\u3092\u512a\u5148\u7684\u306b\u6539\u5584\u3057\u307e\u3059\u3002<br \/>\n3. \u7d99\u7d9a\u7684\u306a\u5b66\u7fd2\uff1a\u89e3\u6790\u7d50\u679c\u304b\u3089\u5f97\u3089\u308c\u305f\u77e5\u898b\u3092\u30c1\u30fc\u30e0\u5185\u3067\u5171\u6709\u3057\u3001\u30b9\u30ad\u30eb\u5411\u4e0a\u306b\u3064\u306a\u3052\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30b5\u30a4\u30af\u30eb\u3092\u56de\u3059\u3053\u3068\u3067\u3001Excel\u30de\u30af\u30ed\u306e\u54c1\u8cea\u3068\u958b\u767a\u52b9\u7387\u304c\u98db\u8e8d\u7684\u306b\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u7d1a\u8005\u5411\u3051\u306eVBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u69cb\u7bc9\u306f\u3001\u4e00\u898b\u96e3\u3057\u305d\u3046\u306b\u611f\u3058\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u3057\u304b\u3057\u3001\u3053\u308c\u3089\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u5805\u7262\u3067\u52b9\u7387\u7684\u306aExcel\u30de\u30af\u30ed\u958b\u767a\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002\u65e5\u3005\u306e\u696d\u52d9\u52b9\u7387\u5316\u306b\u52a0\u3048\u3066\u3001\u9577\u671f\u7684\u306a\u30b3\u30fc\u30c9\u54c1\u8cea\u306e\u5411\u4e0a\u306b\u3082\u53d6\u308a\u7d44\u3093\u3067\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7d1a\u8005\u5411\u3051\uff1aExcel\u30de\u30af\u30ed\u3067\u696d\u52d9\u52b9\u7387\u5316\uff01VBA\u30b3\u30fc\u30c9\u9759\u7684\u89e3\u6790\u30b7\u30b9\u30c6\u30e0\u69cb\u7bc9\u306e\u30dd\u30a4\u30f3\u30c8 \u307e\u305a\u3001Excel\u3092\u4f7f\u3044\u3053\u306a\u3057\u3066\u696d\u52d9\u3092\u52b9\u7387\u5316\u3057\u305f\u3044\u4e0a\u7d1a\u8005\u306e\u65b9\u306b\u3001\u3059\u3050\u306b\u8a66\u305b\u308b\u30de\u30af\u30ed\u30b3\u30fc\u30c9\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\uff1a #8220;`vba Sub<\/p>\n","protected":false},"author":2,"featured_media":661,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-662","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advanced"],"_links":{"self":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/comments?post=662"}],"version-history":[{"count":0,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/posts\/662\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media\/661"}],"wp:attachment":[{"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/media?parent=662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/categories?post=662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hajidai.com\/excel\/wp-json\/wp\/v2\/tags?post=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}