{"id":964,"date":"2022-04-12T22:03:45","date_gmt":"2022-04-12T13:03:45","guid":{"rendered":"http:\/\/160.251.208.217\/?p=964"},"modified":"2025-07-26T22:41:26","modified_gmt":"2025-07-26T13:41:26","slug":"excel-vba-isdate-date","status":"publish","type":"post","link":"https:\/\/it-dxblog.com\/blog\/excel-vba-isdate-date\/","title":{"rendered":"\u3010Excel VBA\u3011IsDate\u95a2\u6570\u306b\u6c17\u3092\u4ed8\u3051\u3066\uff01"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>IsDate<\/strong>\u95a2\u6570\u306eMicrosoft\u306e\u8aac\u660e\u3092\u898b\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"is-style-sango-paragraph-idea wp-block-paragraph\">\u5f0f\u304c\u65e5\u4ed8\u3067\u3042\u308b\u304b\u3001\u6709\u52b9\u306a\u65e5\u4ed8\u307e\u305f\u306f\u6642\u523b\u3068\u3057\u3066\u8a8d\u8b58\u53ef\u80fd\u306a\u5834\u5408\u306b\u306f&nbsp;<strong>True<\/strong>&nbsp;\u3092\u8fd4\u3057\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306b\u306f&nbsp;<strong>False<\/strong>&nbsp;\u3092\u8fd4\u3057\u307e\u3059\u3002<br><br><br><strong>IsDate<\/strong>(<em>expression<\/em>)<br>\u5fc5\u9808<em>\u306e\u5f0f<\/em><a href=\"https:\/\/learn.microsoft.com\/ja-jp\/office\/vba\/language\/glossary\/vbe-glossary#argument\">\u5f15\u6570<\/a>\u306f\u3001<a href=\"https:\/\/learn.microsoft.com\/ja-jp\/office\/vba\/language\/glossary\/vbe-glossary#date-expression\">\u65e5\u4ed8\u307e\u305f\u306f<\/a>\u6642\u523b\u3068\u3057\u3066\u8a8d\u8b58\u3067\u304d\u308b\u65e5\u4ed8\u5f0f\u307e\u305f\u306f<a href=\"https:\/\/learn.microsoft.com\/ja-jp\/office\/vba\/language\/glossary\/vbe-glossary#string-expression\">\u6587\u5b57\u5217\u5f0f<\/a>\u3092\u542b\u3080&nbsp;<a href=\"https:\/\/learn.microsoft.com\/ja-jp\/office\/vba\/language\/glossary\/vbe-glossary#variant-data-type\">Variant<\/a>&nbsp;\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-sgb-headings sgb-heading\" id=\"i-0\"><span class=\"sgb-heading__inner sgb-heading--type2 with-icon\" style=\"background-color:var(--sgb-main-color);border-color:transparent;font-size:1.2em\"><i class=\"fa fa-check-square\" style=\"color:rgba(255,255,255,.6)\"><\/i><span class=\"sgb-heading__text\" style=\"color:#FFF\">\u65e5\u4ed8\u306e\u5224\u5b9a<\/span><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u3053\u306e\u8a18\u4e8b\u3092\u66f8\u3053\u3046\u3068\u601d\u3063\u305f\u306e\u306f\u3001\u4ed5\u4e8b\u3067\u6587\u5b57\u5217\u3068\u3057\u3066<strong>\u897f\u66a6\u306a\u3057\u306e\u65e5\u4ed8\u306e\u307f<\/strong>\uff08\u4f8b\uff1a4\/6, 12\/31\uff09\u304c\u7f85\u5217\u3057\u3066\u3044\u308b\u4e2d\u304b\u3089\u4e00\u756a\u65e9\u3044\u65e5\u4ed8\u3092\u53d6\u3063\u3066\u307b\u3057\u3044\uff01\u3068\u4f9d\u983c\u3055\u308c\u305f\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u897f\u66a6\u304c\u5165\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001<strong>WorksheetFunction.Min\u95a2\u6570<\/strong>\u3092\u4f7f\u7528\u3059\u308c\u3070\u7c21\u5358\u306b\u53d6\u308c\u307e\u3059\u3002<br>\u304c\u3001\u3057\u304b\u3057\u3001\u4eca\u56de\u306f\u897f\u66a6\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u307b\u3068\u3093\u3069\u304c\u76f4\u8fd1\u306e\u65e5\u4ed8\u306e\u305f\u3081\u3001\u6050\u3089\u304f\u4eca\u5e74\u306a\u306e\u3067\u3059\u304c\u3001\u4f9d\u983c\u4e3b\u306e\u65b9\u306b\u304a\u4f3a\u3044\u3059\u308b\u3068\u3001\u4eca\u5f8c\u7d99\u7d9a\u3057\u3066\u5229\u7528\u3059\u308b\u3068<strong>12\u6708\u30681\u6708\u304c\u6df7\u5728<\/strong>\u3059\u308b\u3053\u3068\u304c\u3042\u308b\u3068\u306e\u3053\u3068\u3002<br>\u305d\u3046\u306a\u308b\u3068\uff11\u6708\u306812\u6708\u304c\u6df7\u3058\u3063\u305f\u30c7\u30fc\u30bf\u306e\u5834\u5408\u3001\u8aa4\u3063\u305f\u7d50\u679c\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u3053\u3067<strong>IsDate\u95a2\u6570<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u897f\u66a6\u304c\u306a\u3044\u3082\u306e\u306f\u65e5\u4ed8\u578b\u3067\u306a\u3044\u3068\u5224\u5b9a\u3057\u3066\u3001\u305d\u306e\u5834\u5408\u306f\u5225\u306e\u65b9\u6cd5\u3092\u53d6\u308d\u3046\u3068\u8003\u3048\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3057\u304b\u3057\u3001<strong>IsDate\u95a2\u6570<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u307f\u308b\u3068\u897f\u66a6\u306e\u306a\u3044\u65e5\u4ed8\u3092\u5224\u5b9a\u3059\u308b\u3068<strong>True<\/strong>\u3068\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002<br>\u3088\u304f\u3088\u304f\u8abf\u3079\u308b\u3068<strong>CDate\u95a2\u6570<\/strong>\u3068\u3057\u3066\u5909\u63db\u3067\u304d\u308b\u3082\u306e\u306f\u3059\u3079\u3066<strong>True<\/strong>\u306b\u306a\u308b\u3068\u306e\u3053\u3068\u3002<br><br>\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u3044\u308d\u3044\u308d\u306a\u5024\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-sgb-codebox pre_tag\"><span><i class=\"fa fa-code\"><\/i>Excel VBA<\/span><pre><code>Sub test()\nApplication.ScreenUpdating = False\n   \n   Dim i As Long\n   \n   With Sheet1\n   \n   On Error Resume Next\n      \n      For i = 2 To 15\n         \n         .Cells(i, 2) = IsDate(.Cells(i, 1))\n         .Cells(i, 3) = CDate(.Cells(i, 1))\n      \n      Next i\n      \n   On Error GoTo 0\n   \n   End With\n   \nApplication.ScreenUpdating = True\nEnd Sub<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u3044\u308d\u3044\u308d\u8a66\u3057\u3066\u307f\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306a\u5224\u5b9a\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"418\" src=\"http:\/\/160.251.208.217\/wp-content\/uploads\/2022\/04\/image-12.png\" alt=\"\" class=\"wp-image-2845\" srcset=\"https:\/\/it-dxblog.com\/blog\/wp-content\/uploads\/2022\/04\/image-12.png 482w, https:\/\/it-dxblog.com\/blog\/wp-content\/uploads\/2022\/04\/image-12-300x260.png 300w\" sizes=\"auto, (max-width: 482px) 100vw, 482px\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\uff13\u3064\u306f\u3088\u304f\u898b\u308b\u65e5\u7a0b\u306e\u8868\u8a18\u3067\u3059\u3002\u3082\u3061\u308d\u3093\u3069\u3061\u3089\u3082\u65e5\u4ed8\u3068\u3057\u3066\u8a8d\u8b58\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2025_7_26\u30012025\/7\/26\u306f\u3084\u306f\u308a\u5de6\u5074\u306b\u3088\u3063\u3066\u6587\u5b57\u5217\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304b\u3089\u3001\u3069\u3061\u3089\u306e\u95a2\u6570\u3082\u65e5\u4ed8\u3068\u3057\u3066\u8a8d\u8b58\u306f\u3057\u3066\u3082\u3089\u3048\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br>20250726\u3082\u540c\u69d8\u306b\u65e5\u4ed8\u3068\u3057\u3066\u8a8d\u8b58\u306f\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>8\u884c\u76ee\u306e7\/26\u3067\u3059\u304c\u3001\u8868\u8a18\u306f7\/26\u3067\u3059\u304c\u3001\u5165\u529b\u6642\u300c\u20197\/26\u300d\u3068\u982d\u306b\u30a2\u30dd\u30b9\u30c8\u30ed\u30d5\u30a3\u3092\u4ed8\u3051\u3066\u5165\u529b\u3057\u307e\u3057\u305f\u3002\u3084\u306f\u308a\u897f\u66a6\u304c\u306a\u3044\u6587\u5b57\u5217\u306e\u201d7\/26\u2033\u3067\u3082\u65e5\u4ed8\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c13\/32\/2025\u300d\u306f12\u304b\u6708\u3057\u304b\u306a\u3044\u6708\u309213\u6708\u306b\u3001\u65e5\u4ed8\u309232\u65e5\u306b\u3057\u3066\u307f\u305f\u3089\u3069\u3061\u3089\u3082\u65e5\u4ed8\u8a8d\u8b58\u306f\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e88\u60f3\u5916\u3060\u3063\u305f\u306e\u306f\u8d64\u67a0\u3067\u56f2\u3063\u305f\u90e8\u5206\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">12\u884c\u76ee\u306f2025\/7\/26\u3092\u30b7\u30ea\u30a2\u30eb\u5024\u306b\u3057\u305f\u3082\u306e\u3067\u3059\u3002IsDate\u95a2\u6570\u306f\u3053\u306e\u30b7\u30ea\u30a2\u30eb\u5024\u3092<strong><span class=\"keiko_red\">False<\/span><\/strong>\u3068\u5224\u5b9a\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br>CDate\u95a2\u6570\u306f\u554f\u984c\u306a\u304f\u65e5\u4ed8\u5224\u5b9a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<br>CDate\u3068IsDate\u3067\u7d50\u679c\u304c\u5225\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">13\u884c\u76ee\u306f\u300c00002025\/0007\/0026\u300d\u3068\u3057\u3066\u3042\u308a\u3048\u306a\u3044\u6841\u6570\u3067\u5165\u529b\u3057\u307e\u3057\u305f\u304c\u3001IsDate\u95a2\u6570\u3082CDate\u95a2\u6570\u3082\u65e5\u4ed8\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u307e\u3059\u3002<br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">14\u884c\u76ee\u306f\u300c7:26\u300d\u3068\u5165\u529b\u3057\u307e\u3057\u305f\u304c\u3001IsDate\u95a2\u6570\u306fFalse\u3001CDate\u95a2\u6570\u306fTrue\u306b\u306a\u308a\u5225\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">15\u884c\u76ee\u306f\u300c\u201925\/7\/26\u300d\u3068\u5165\u529b\u3057\u307e\u3057\u305f\u3002\u6587\u5b57\u5217\u3068\u3057\u3066\u8a8d\u8b58\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u5de6\u5074\u306b\u3088\u3063\u3066\u3044\u307e\u3059\u3002<br>\u305d\u308c\u3067\u3082IsDate\u95a2\u6570\u3001CDate\u95a2\u6570\u3068\u3082True\u5224\u5b9a\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u3093\u306a\u306b\u7de9\u3044\u3068\u897f\u66a6\u306e\u3042\u308b\u65e5\u4ed8\u304b\u305d\u3046\u3067\u306a\u3044\u304b\u306e\u5224\u5b9a\u306f\u96e3\u3057\u3044\u305f\u3081\u3001\u5225\u306e\u65b9\u6cd5\u3067\u8003\u3048\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u897f\u66a6\u306e\u3042\u308bDate\u578b\u306e\u5834\u5408\u3001\u5fc5\u305a\u30c7\u30fc\u30bf\u306b\u306f\u30b9\u30e9\u30c3\u30b7\u30e5\uff08\/\uff09\u304c\u5165\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<br>\u4eca\u56de\u306f\u30b9\u30e9\u30c3\u30b7\u30e5\u306e\u6570\u3092\u5224\u5b9a\u3057\u3066\u3001\u65e5\u4ed8\u306e\u5224\u5b9a\u3092\u884c\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"wp-block-sgb-codebox pre_tag\"><span><i class=\"fa fa-code\"><\/i>Excel VBA<\/span><pre><code>Dim cnt as long, i as long\n\nWith sheet1\n\n   For i = 2 To 11\n            \n      cnt = Len(.Cells(i, 1)) - Len(Replace(.Cells(i, 1), \"\/\", \"\"))\n            \n      If cnt = 2 Then\n         '\u897f\u66a6\u3042\u308a\u306e\u65e5\u4ed8\n      Else\n         '\u897f\u66a6\u306a\u3057\u306e\u65e5\u4ed8\n      End If\n   Next i\n\nEnd with<\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u306e\u5834\u5408\u306f\u3001\u30b9\u30e9\u30c3\u30b7\u30e5\u3067\u5224\u5b9a\u3057\u307e\u3057\u305f\u304c\u3001\u5165\u529b\u3055\u308c\u3066\u3044\u308b\u5024\u306b\u3088\u308a\u65e5\u4ed8\u306e\u5224\u5b9a\u306f\u8003\u3048\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u65e5\u4ed8\u3092\u5165\u529b\u3057\u3066\u3044\u3066\u3082\u8868\u8a18\u304c\u30b7\u30ea\u30a2\u30eb\u5024\u306e\u5834\u5408\u306f\u65e5\u4ed8\u8a8d\u5b9a\u3055\u308c\u306a\u3044\u306e\u3067\u3001\u5165\u529b\u5024\u304c\u3088\u304f\u3066\u3082\u8868\u8a18\u3092\u65e5\u4ed8\u578b\u306b\u5909\u3048\u306a\u3044\u3068IsDate\u95a2\u6570\u306f\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001\u96e3\u3057\u3044\u3067\u3059\u306d\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IsDate\u95a2\u6570\u306eMicrosoft\u306e\u8aac\u660e\u3092\u898b\u308b\u3068\u4e0b\u8a18\u306e\u3088\u3046\u306b\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002 \u5f0f\u304c\u65e5\u4ed8\u3067\u3042\u308b\u304b\u3001\u6709\u52b9\u306a\u65e5\u4ed8\u307e\u305f\u306f\u6642\u523b\u3068\u3057\u3066\u8a8d\u8b58\u53ef\u80fd\u306a\u5834\u5408\u306b\u306f&nbsp;True&nbsp;\u3092\u8fd4\u3057\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306b\u306f&nbsp;Fals &#8230; <\/p>\n","protected":false},"author":2,"featured_media":2028,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[6],"tags":[237],"class_list":["post-964","post","type-post","status-publish","format-standard","has-post-thumbnail","category-vba","tag-237","entry"],"_links":{"self":[{"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/posts\/964","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/comments?post=964"}],"version-history":[{"count":3,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/posts\/964\/revisions"}],"predecessor-version":[{"id":2846,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/posts\/964\/revisions\/2846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/media\/2028"}],"wp:attachment":[{"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/media?parent=964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/categories?post=964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it-dxblog.com\/blog\/wp-json\/wp\/v2\/tags?post=964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}