{"id":1835,"date":"2025-10-14T11:19:17","date_gmt":"2025-10-14T02:19:17","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=1835"},"modified":"2026-01-14T11:30:55","modified_gmt":"2026-01-14T02:30:55","slug":"vba%e6%97%a5%e4%bb%98%e6%96%87%e5%ad%97%e5%88%97%e5%a4%89%e6%8f%9b%e3%82%92%e5%ae%8c%e5%85%a8%e7%90%86%e8%a7%a3%ef%bd%9cformat%e3%83%bbcdate%e3%81%a8%e3%82%a8%e3%83%a9%e3%83%bc%e5%9b%9e%e9%81%bf","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1835\/","title":{"rendered":"VBA\u65e5\u4ed8\u6587\u5b57\u5217\u5909\u63db\u3092\u5b8c\u5168\u7406\u89e3\uff5cFormat\u30fbCDate\u3068\u30a8\u30e9\u30fc\u56de\u907f\u306e\u539f\u7406"},"content":{"rendered":"<div>\n<h2>\u306f\u3058\u3081\u306b\uff5c\u3053\u306e\u8a18\u4e8b\u3067\u5f97\u3089\u308c\u308b\u4fa1\u5024<\/h2>\n<p>\n    VBA\u3067<strong>\u65e5\u4ed8<\/strong>\u3068<strong>\u6587\u5b57\u5217<\/strong>\u306e\u5909\u63db\u3001\u624b\u304c\u6b62\u307e\u3063\u3066\u3057\u307e\u3063\u305f\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<br \/>\n    \u300c\u30d5\u30a1\u30a4\u30eb\u540d\u306b<code>yyyymmdd<\/code>\u5f62\u5f0f\u306e\u65e5\u4ed8\u3092\u5165\u308c\u305f\u3044\u306e\u306b\u3001\u3084\u308a\u65b9\u304c\u5206\u304b\u3089\u306a\u3044\u2026\u300d<br \/>\n    \u300c\u6587\u5b57\u5217\u3092\u65e5\u4ed8\u306b\u3057\u3088\u3046\u3068<strong>CDate<\/strong>\u3092\u4f7f\u3063\u305f\u3089\u3001\u300e\u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\u300f\u30a8\u30e9\u30fc\u3067\u30cf\u30de\u3063\u305f\u2026\u300d<br \/>\n    \u79c1\u305f\u3061\u73fe\u5834\u306e\u958b\u767a\u8005\u304c\u5fc5\u305a\u4e00\u5ea6\u306f\u906d\u9047\u3059\u308b\u60a9\u307f\u3067\u3059\u3002<\/p>\n<p>    \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<strong>\u300c\u306a\u305c\uff1f\u300d\u306b\u5fdc\u3048\u3064\u3064\u3001\u5b9f\u52d9\u3067\u4f7f\u3048\u308b\u30b5\u30f3\u30d7\u30eb\u3068\u201c\u8179\u843d\u3061\u201d\u89e3\u8aac\u3067\u4e00\u6c17\u306b\u89e3\u6c7a<\/strong>\u3057\u307e\u3059\u3002<br \/>\n    <strong>Format<\/strong>\/<strong>CDate<\/strong>\u306e\u4f7f\u3044\u5206\u3051\u3084\u3001\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u30fb\u5bfe\u7b56\u307e\u3067\u3001<br \/>\n    <strong>\u3084\u308a\u305f\u3044\u3053\u3068\u304b\u3089\u63a2\u305b\u308b\u9006\u5f15\u304d\u5f62\u5f0f<\/strong>\uff0b\u300c\u306a\u305c\u52d5\u304f\u306e\u304b\u300d\u306e\u7406\u5c48\u3082\u4e01\u5be7\u306b\u30ab\u30d0\u30fc\u3002<br \/>\n    \u3053\u306e\u8a18\u4e8b\u3067\u3001\u65e5\u4ed8\u3068\u6587\u5b57\u5217\u5909\u63db\u306e\u7591\u554f\u3092\u4e00\u7dd2\u306b\u30b9\u30c3\u30ad\u30ea\u89e3\u6c7a\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n    <br \/>\n    \uff08VBA\u306e\u57fa\u790e\u3084\u73fe\u5834\u6d3b\u7528\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1747\/\" target=\"_blank\" rel=\"noopener\">SES\u73fe\u5834\u3067VBA\u3067\u304d\u307e\u3059\u304b\uff1f\u672a\u7d4c\u9a13\u5411\u3051Excel\u30de\u30af\u30ed\u5b9f\u8df5\u8853<\/a>\u300f\u3082\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<hr \/>\n<h2>1. \u30b7\u30ea\u30a2\u30eb\u5024\u3068\u306f\uff1fVBA\u65e5\u4ed8\u51e6\u7406\u306e\u5927\u539f\u5247<\/h2>\n<p>\n    \u300cExcel\u3067\u65e5\u4ed8\u3092\u3069\u3046\u7ba1\u7406\u3057\u3066\u3044\u308b\u304b\u300d\u3001\u610f\u5916\u3068\u77e5\u3089\u308c\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n    \u5b9f\u306f<strong>\u30b7\u30ea\u30a2\u30eb\u5024<\/strong>\u3068\u3044\u3046\u300c\u65e5\u4ed8\u3092\u6570\u5b57\u3067\u6301\u3064\u4ed5\u7d44\u307f\u300d\u304c\u30ab\u30ae\u3067\u3059\u3002\n  <\/p>\n<ul>\n<li><strong>1900\/1\/1<\/strong> \u2192 <strong>1<\/strong><\/li>\n<li><strong>2024\/1\/14<\/strong> \u2192 <strong>45305<\/strong><\/li>\n<li><strong>2024\/1\/14 12:00<\/strong> \u2192 <strong>45305.5<\/strong><\/li>\n<\/ul>\n<p>\n    \u3064\u307e\u308a\u3001<strong>\u65e5\u4ed8\u306e\u6b63\u4f53\u306f\u305f\u3060\u306e\u6570\u5024<\/strong>\u3002<br \/>\n    \u30bb\u30eb\u306e\u300cyyyy\/mm\/dd\u300d\u8868\u793a\u306f\u201c\u898b\u305f\u76ee\u201d\u3092\u5909\u3048\u3066\u3044\u308b\u3060\u3051\u3067\u3001<strong>Date<\/strong>\u578b\u5909\u6570\u306b\u306f\u30b7\u30ea\u30a2\u30eb\u5024\u304c\u5165\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n    \u3053\u306e\u539f\u5247\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001<strong>\u5909\u63db\u306e\u4ed5\u7d44\u307f\u3084\u30a8\u30e9\u30fc\u539f\u56e0<\/strong>\u3082\u4e00\u6c17\u306b\u898b\u901a\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aVBA<\/strong><br \/>\n      Microsoft Excel\u306a\u3069\u3067\u4f7f\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3002\u696d\u52d9\u81ea\u52d5\u5316\u3084\u30c7\u30fc\u30bf\u51e6\u7406\u306b\u5e83\u304f\u5229\u7528\u3055\u308c\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b7\u30ea\u30a2\u30eb\u5024<\/strong><br \/>\n      Excel\u3084VBA\u3067\u65e5\u4ed8\u30fb\u6642\u523b\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u300c\u9023\u756a\u306e\u6570\u5024\u300d\u30021900\/1\/1\u30921\u3068\u3057\u3066\u30011\u65e5\u3054\u3068\u306b1\u305a\u3064\u5897\u3048\u308b\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>2. \u9006\u5f15\u304d\uff1a\u65e5\u4ed8\u21d4\u6587\u5b57\u5217 \u5909\u63db\u30b3\u30fc\u30c9\u96c6<\/h2>\n<p>\n    \u300c\u7406\u5c48\u3088\u308a\u3001\u307e\u305a\u52d5\u304f\u30b5\u30f3\u30d7\u30eb\u304c\u6b32\u3057\u3044\uff01\u300d<br \/>\n    \u79c1\u305f\u3061\u306e\u73fe\u5834\u3067\u306f\u3001\u3053\u3093\u306a\u6642\u304c\u3088\u304f\u3042\u308a\u307e\u3059\u3002<br \/>\n    \u3053\u3053\u3067\u306f<strong>\u983b\u51fa\u30b7\u30fc\u30f3\u5225\u306b\u201c\u30b3\u30d4\u30daOK\u201d\u306a\u30b3\u30fc\u30c9\u4f8b<\/strong>\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<br \/>\n    <br \/>\n    \uff08\u65e5\u4ed8\u3084\u578b\u5909\u63db\u306e\u57fa\u790e\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1219\/\" target=\"_blank\" rel=\"noopener\">\u3010\u5b8c\u5168\u7248\u3011\u578b\u306e\u5909\u63db\u3068\u306f\uff1f\u30ad\u30e3\u30b9\u30c8\u306e\u57fa\u672c\u3068\u843d\u3068\u3057\u7a74\u300d | Java\u30fbJavaScript\u30fbTypeScript\u3067\u5fb9\u5e95\u7406\u89e3\u3059\u308b\u578b\u306e\u6271\u3044\u65b9<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<h3>2-1. \u30d5\u30a1\u30a4\u30eb\u540d\u306b\u300cyyyymmdd\u300d\u5f62\u5f0f\u306e\u65e5\u4ed8\u3092\u5165\u308c\u308b<\/h3>\n<pre><code>\r\nSub ConvertToYYYYMMDD()\r\n    Dim todayDate As Date\r\n    Dim formattedDate As String\r\n\r\n    todayDate = Date '\u73fe\u5728\u306e\u65e5\u4ed8\u3092\u53d6\u5f97\r\n    formattedDate = Format(todayDate, \"yyyymmdd\")\r\n\r\n    Debug.Print formattedDate '\u4f8b: \"20240114\"\r\nEnd Sub\r\n  <\/code><\/pre>\n<h3>2-2. \u5e33\u7968\u3067\u548c\u66a6\uff0b\u66dc\u65e5\u3092\u4f7f\u3044\u305f\u3044<\/h3>\n<pre><code>\r\nSub ConvertToWareki()\r\n    Dim targetDate As Date\r\n    Dim formattedDate As String\r\n\r\n    targetDate = #1\/14\/2024#\r\n\r\n    formattedDate = Format(targetDate, \"ggge\u5e74m\u6708d\u65e5 (aaa)\")\r\n\r\n    Debug.Print formattedDate '\u4f8b: \"\u4ee4\u548c6\u5e741\u670814\u65e5 (\u65e5)\"\r\nEnd Sub\r\n  <\/code><\/pre>\n<h3>2-3. \u300cyyyy\/mm\/dd hh:mm:ss\u300d\u5f62\u5f0f\u3067\u30ed\u30b0\u51fa\u529b<\/h3>\n<pre><code>\r\nSub ConvertWithTime()\r\n    Dim nowDateTime As Date\r\n    Dim formattedDateTime As String\r\n\r\n    nowDateTime = Now\r\n\r\n    formattedDateTime = Format(nowDateTime, \"yyyy\/mm\/dd hh:mm:ss\")\r\n\r\n    Debug.Print formattedDateTime\r\nEnd Sub\r\n  <\/code><\/pre>\n<h3>2-4. \u6587\u5b57\u5217\u3092\u65e5\u4ed8\u30c7\u30fc\u30bf\u306b\u5909\u63db\u3059\u308b<\/h3>\n<pre><code>\r\nSub ConvertStringToDate()\r\n    Dim dateStr1 As String\r\n    Dim dateStr2 As String\r\n    Dim convertedDate1 As Date\r\n    Dim convertedDate2 As Date\r\n\r\n    dateStr1 = \"\u4ee4\u548c6\u5e741\u670814\u65e5\"\r\n    dateStr2 = \"2024.01.14\"\r\n\r\n    convertedDate1 = CDate(dateStr1)\r\n    convertedDate2 = CDate(dateStr2)\r\n\r\n    Debug.Print convertedDate1\r\n    Debug.Print TypeName(convertedDate1) 'Date\r\n    Debug.Print convertedDate2\r\nEnd Sub\r\n  <\/code><\/pre>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aCDate\u95a2\u6570<\/strong><br \/>\n      \u6587\u5b57\u5217\u3084\u6570\u5024\u3092\u300c\u65e5\u4ed8\u578b\uff08Date\u578b\uff09\u300d\u306b\u5909\u63db\u3059\u308bVBA\u306e\u95a2\u6570\u3002\u66f8\u5f0f\u304c\u5408\u308f\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3053\u3068\u3082\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDate\u578b<\/strong><br \/>\n      \u65e5\u4ed8\u3084\u6642\u523b\u3092\u6271\u3046\u305f\u3081\u306eVBA\u306e\u30c7\u30fc\u30bf\u578b\u3002\u30b7\u30ea\u30a2\u30eb\u5024\u3068\u3057\u3066\u5185\u90e8\u7ba1\u7406\u3055\u308c\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDate\u95a2\u6570<\/strong><br \/>\n      \u73fe\u5728\u306e\u65e5\u4ed8\uff08\u6642\u523b\u306f0:00:00\uff09\u3092\u53d6\u5f97\u3059\u308bVBA\u306e\u95a2\u6570\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aNow\u95a2\u6570<\/strong><br \/>\n      \u73fe\u5728\u306e\u65e5\u4ed8\u3068\u6642\u523b\u3092\u53d6\u5f97\u3059\u308bVBA\u306e\u95a2\u6570\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aFormat\u95a2\u6570<\/strong><br \/>\n      VBA\u3067\u65e5\u4ed8\u3084\u6570\u5024\u3092\u597d\u304d\u306a\u66f8\u5f0f\uff08\u4f8b\uff1ayyyy\/mm\/dd\uff09\u306b\u5909\u63db\u3067\u304d\u308b\u95a2\u6570\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u3084\u5e33\u7968\u51fa\u529b\u3067\u3088\u304f\u4f7f\u3046\u3002\n    <\/p>\n<\/blockquote>\n<p>\u305c\u3072\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30da\u3057\u3066\u3001\u307e\u305a\u306f\u52d5\u304b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<hr \/>\n<h2>3. \u4e3b\u8981\u95a2\u6570\u306e\u9055\u3044\u3068\u9078\u3073\u65b9<\/h2>\n<p>\n    \u300c\u306a\u305c<strong>Format<\/strong>\u306a\u306e\u304b\uff1f\u300d\u300c<strong>CDate<\/strong>\u4ee5\u5916\u306b\u3082\u65b9\u6cd5\u306f\uff1f\u300d<br \/>\n    \u3053\u3053\u3067\u306f\u65e5\u4ed8\u21d4\u6587\u5b57\u5217\u306e\u5909\u63db\u3067\u3088\u304f\u4f7f\u3046<strong>\u4e3b\u8981\u95a2\u65704\u7a2e<\/strong>\u3092\u6574\u7406\u3057\u307e\u3059\u3002\n  <\/p>\n<h3>3-1. \u65e5\u4ed8\u2192\u6587\u5b57\u5217\uff1aFormat vs CStr<\/h3>\n<ul>\n<li>\n      <strong>Format<\/strong><br \/>\n      \u66f8\u5f0f\u6307\u5b9a\u3067\u601d\u3044\u901a\u308a\u306e\u5f62\u306b\u5909\u63db\u3067\u304d\u308b\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u306a\u3069\u610f\u56f3\u3057\u305f\u5f62\u5f0f\u306a\u3089<strong>Format<\/strong>\u304c\u5fc5\u9808\u3002\n    <\/li>\n<li>\n      <strong>CStr<\/strong><br \/>\n      \u300c\u3068\u308a\u3042\u3048\u305a\u6587\u5b57\u5217\u5316\u300d\u306a\u3089\u3053\u308c\u3002\u305f\u3060\u3057<strong>OS\u306e\u5730\u57df\u8a2d\u5b9a\u4f9d\u5b58<\/strong>\u3067\u3001\u60f3\u5b9a\u5916\u306e\u66f8\u5f0f\u306b\u306a\u308b\u5371\u967a\u3042\u308a\u3002\n    <\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aCStr\u95a2\u6570<\/strong><br \/>\n      \u3069\u3093\u306a\u5024\u3067\u3082\u300c\u6587\u5b57\u5217\u578b\u300d\u306b\u5909\u63db\u3059\u308bVBA\u306e\u95a2\u6570\u3002\u65e5\u4ed8\u3084\u6570\u5024\u3082\u4e00\u65e6\u6587\u5b57\u5217\u306b\u3057\u305f\u3044\u6642\u306b\u4f7f\u3046\u3002\n    <\/p>\n<\/blockquote>\n<h3>3-2. \u6587\u5b57\u5217\u2192\u65e5\u4ed8\uff1aCDate vs DateValue<\/h3>\n<ul>\n<li>\n      <strong>CDate<\/strong><br \/>\n      \u65e5\u4ed8\u30fb\u6642\u523b\u3069\u3061\u3089\u3082\u89e3\u91c8\u3002\u591a\u304f\u306e\u30b1\u30fc\u30b9\u306f\u3053\u308c\u4e00\u629e\u3002\n    <\/li>\n<li>\n      <strong>DateValue<\/strong><br \/>\n      \u300c\u65e5\u4ed8\u90e8\u5206\u3060\u3051\u300d\u5909\u63db\u3057\u305f\u3044\u306a\u3089\u4f7f\u3046\u3002\u6642\u523b\u306f\u7121\u8996\u3002\n    <\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDateValue\u95a2\u6570<\/strong><br \/>\n      \u6587\u5b57\u5217\u304b\u3089\u300c\u65e5\u4ed8\u90e8\u5206\u3060\u3051\u300d\u3092Date\u578b\u306b\u5909\u63db\u3059\u308bVBA\u306e\u95a2\u6570\u3002\u6642\u523b\u60c5\u5831\u306f\u5207\u308a\u6368\u3066\u3089\u308c\u308b\u3002\n    <\/p>\n<\/blockquote>\n<h3>3-3. \u73fe\u5728\u65e5\u6642\u306e\u53d6\u5f97\uff1aNow \/ Date \/ Time<\/h3>\n<ul>\n<li><strong>Now<\/strong>\uff1a\u65e5\u4ed8\uff0b\u6642\u523b\uff08\u4f8b\uff1a2024\/01\/14 15:30:00\uff09<\/li>\n<li><strong>Date<\/strong>\uff1a\u65e5\u4ed8\u306e\u307f\uff08\u6642\u523b\u306f0:00:00\uff09<\/li>\n<li><strong>Time<\/strong>\uff1a\u6642\u523b\u306e\u307f\uff081899\/12\/30\uff09<\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aTime\u95a2\u6570<\/strong><br \/>\n      \u73fe\u5728\u306e\u6642\u523b\u306e\u307f\uff081899\/12\/30\u57fa\u6e96\uff09\u3092\u53d6\u5f97\u3059\u308bVBA\u306e\u95a2\u6570\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>4. \u300c\u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093\u300d\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u5bfe\u7b56<\/h2>\n<p>\n    <strong>CDate<\/strong>\u3067\u5909\u63db\u3057\u305f\u3089<strong>\u578b\u304c\u4e00\u81f4\u3057\u307e\u305b\u3093<\/strong>\u3001\u306a\u305c\u2026\uff1f<br \/>\n    \u3088\u304f\u3042\u308b\u201c\u30cf\u30de\u308a\u30dd\u30a4\u30f3\u30c8\u201d\u30923\u3064\u306b\u6574\u7406\u3057\u307e\u3059\u3002\n  <\/p>\n<h3>4-1. \u5168\u89d2\u6587\u5b57\u30fb\u4f59\u8a08\u306a\u30b9\u30da\u30fc\u30b9<\/h3>\n<ul>\n<li><strong>NG\u4f8b<\/strong>: <code>\uff12\uff10\uff12\uff14\uff0f\uff10\uff11\uff0f\uff11\uff14 <\/code><\/li>\n<li><strong>\u5bfe\u7b56<\/strong>: <strong>Trim<\/strong>\uff0b<strong>StrConv<\/strong>\u3067\u30b9\u30da\u30fc\u30b9\u524a\u9664\uff06\u534a\u89d2\u5909\u63db<\/li>\n<\/ul>\n<pre><code>\r\nDim dirtyStr As String\r\ndirtyStr = \"\u3000\uff12\uff10\uff12\uff14\uff0e\uff11\uff0e\uff11\uff14\u3000\"\r\nDim cleanStr As String\r\ncleanStr = Trim(StrConv(dirtyStr, vbNarrow))\r\nDim resultDate As Date\r\nresultDate = CDate(cleanStr)\r\n  <\/code><\/pre>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aTrim\u95a2\u6570<\/strong><br \/>\n      \u6587\u5b57\u5217\u306e\u524d\u5f8c\u306b\u3042\u308b\u7a7a\u767d\uff08\u30b9\u30da\u30fc\u30b9\u3084\u30bf\u30d6\uff09\u3092\u53d6\u308a\u9664\u304fVBA\u306e\u95a2\u6570\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aStrConv\u95a2\u6570<\/strong><br \/>\n      \u6587\u5b57\u5217\u3092\u5168\u89d2\u30fb\u534a\u89d2\u3084\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3067\u304d\u308bVBA\u306e\u95a2\u6570\u3002vbNarrow\u3067\u534a\u89d2\u5316\u3002\n    <\/p>\n<\/blockquote>\n<p>  \uff08\u65e5\u4ed8\u578b\u30a8\u30e9\u30fc\u3084SQL\u65e5\u4ed8\u51e6\u7406\u306e\u5931\u6557\u56de\u907f\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1786\/\" target=\"_blank\" rel=\"noopener\">SQL\u65e5\u4ed8\u95a2\u6570\u306e\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u73fe\u5834\u3067\u4f7f\u3048\u308b\u30c6\u30f3\u30d7\u30ec\u30fb\u5931\u6557\u56de\u907f\u6cd5\u3082\u89e3\u8aac<\/a\n  >\u300f\u3082\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09<\/p>\n<h3>4-2. OS\u5730\u57df\u8a2d\u5b9a\u3068\u7570\u306a\u308b\u66f8\u5f0f<\/h3>\n<ul>\n<li>\u4f8b\uff1aOS\u304c<code>yyyy\/MM\/dd<\/code>\u306a\u306e\u306b<code>14-01-2024<\/code>\u306a\u3069<\/li>\n<li><strong>\u5bfe\u7b56<\/strong>: \u53ef\u80fd\u306a\u3089ISO 8601\uff08<code>yyyy-MM-dd<\/code>\uff09\u306b\u7d71\u4e00\u3059\u308b<\/li>\n<\/ul>\n<h3>4-3. \u5b58\u5728\u3057\u306a\u3044\u65e5\u4ed8<\/h3>\n<ul>\n<li>\u4f8b\uff1a<code>2024\/02\/30<\/code>\u306fNG<\/li>\n<li><strong>\u5bfe\u7b56<\/strong>: <strong>IsDate<\/strong>\u3067\u4e8b\u524d\u30c1\u30a7\u30c3\u30af\u3092\u5fb9\u5e95<\/li>\n<\/ul>\n<pre><code>\r\nDim dateStr As String\r\ndateStr = \"2024\/2\/30\"\r\n\r\nIf IsDate(dateStr) Then\r\n    Debug.Print CDate(dateStr)\r\nElse\r\n    Debug.Print \"\u6709\u52b9\u306a\u65e5\u4ed8\u6587\u5b57\u5217\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\"\r\nEnd If\r\n  <\/code><\/pre>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aIsDate\u95a2\u6570<\/strong><br \/>\n      \u6587\u5b57\u5217\u3084\u5024\u304c\u300c\u6709\u52b9\u306a\u65e5\u4ed8\u300d\u3068\u3057\u3066\u8a8d\u8b58\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3059\u308bVBA\u306e\u95a2\u6570\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>5. \u5fdc\u7528\u30fb\u767a\u5c55\u30c6\u30af\u30cb\u30c3\u30af<\/h2>\n<h3>5-1. \u914d\u5217\u3067\u4e00\u62ec\u51e6\u7406\u3057\u3066\u30b9\u30d4\u30fc\u30c9UP<\/h3>\n<p>\u6570\u767e\u301c\u6570\u5343\u4ef6\u306e\u5909\u63db\u306f\u3001\u30bb\u30eb\u64cd\u4f5c\u3088\u308a<strong>\u914d\u5217<\/strong>\u3067\u307e\u3068\u3081\u3066\u51e6\u7406\u2192\u4e00\u62ec\u66f8\u304d\u623b\u3057\u304c\u9244\u5247\u3002<\/p>\n<p>\n    \uff08AI\u3084VBA\u3092\u6d3b\u7528\u3057\u305fExcel\u696d\u52d9\u52b9\u7387\u5316\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1699\/\" target=\"_blank\" rel=\"noopener\">VBA\u00d7AI\u3067Excel\u30b7\u30fc\u30c8\u60c5\u5831\u4f1d\u9054\u738798%\uff01CSV\u5909\u63db\u30fb\u30ef\u30a4\u30e4\u30fc\u30d5\u30ec\u30fc\u30e0\u51fa\u529b\u306e\u5168\u624b\u9806<\/a\n    >\u300f\u3082\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<h3>5-2. N\u65e5\u5f8c\u30fbN\u30f6\u6708\u5f8c\u30fb\u6708\u672b\u65e5\u306e\u8a08\u7b97<\/h3>\n<ul>\n<li>N\u65e5\u5f8c\uff0fN\u30f6\u6708\u5f8c\uff1a<strong>DateAdd<\/strong>\u3067\u67d4\u8edf\u306b<\/li>\n<li>\u6708\u672b\u65e5\uff1a<strong>DateSerial(Year(d), Month(d) + 1, 1) &#8211; 1<\/strong> \u3067\u4e00\u767a\u53d6\u5f97<\/li>\n<\/ul>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDateAdd\u95a2\u6570<\/strong><br \/>\n      \u65e5\u4ed8\u306b\u300c\u65e5\u30fb\u6708\u30fb\u5e74\u300d\u306a\u3069\u3092\u52a0\u7b97\u3067\u304d\u308bVBA\u306e\u95a2\u6570\u3002\u5c06\u6765\u65e5\u3084\u904e\u53bb\u65e5\u3092\u7c21\u5358\u306b\u8a08\u7b97\u3067\u304d\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDateSerial\u95a2\u6570<\/strong><br \/>\n      \u5e74\u30fb\u6708\u30fb\u65e5\u3092\u6307\u5b9a\u3057\u3066\u65e5\u4ed8\uff08Date\u578b\uff09\u3092\u4f5c\u308bVBA\u306e\u95a2\u6570\u3002\u6708\u672b\u65e5\u8a08\u7b97\u306b\u3082\u4fbf\u5229\u3002\n    <\/p>\n<\/blockquote>\n<h3>5-3. Power Query\u3068\u306e\u6bd4\u8f03<\/h3>\n<p>\n    \u5b9a\u578b\u30c7\u30fc\u30bf\u306a\u3089<strong>Power Query<\/strong>\u306eGUI\u5909\u63db\u3082\u9078\u629e\u80a2\u3002<br \/>\n    \u8907\u96d1\u30ed\u30b8\u30c3\u30af\u306f<strong>VBA<\/strong>\u3067\u3001\u3046\u307e\u304f\u4f7f\u3044\u5206\u3051\u307e\u3057\u3087\u3046\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aPower Query<\/strong><br \/>\n      Excel\u306b\u642d\u8f09\u3055\u308c\u305f\u30c7\u30fc\u30bf\u5909\u63db\u30fb\u96c6\u8a08\u30c4\u30fc\u30eb\u3002GUI\u64cd\u4f5c\u3067\u30c7\u30fc\u30bf\u52a0\u5de5\u304c\u3067\u304d\u3001VBA\u3088\u308a\u3082\u7c21\u5358\u306a\u5834\u5408\u3082\u591a\u3044\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>6. \u3088\u304f\u3042\u308b\u8cea\u554f\uff08FAQ\uff09<\/h2>\n<ul>\n<li>\n      <strong>Q1. Format\u95a2\u6570\u306e\u66f8\u5f0f\u6307\u5b9a\u5b50\uff08m\/mm\u3001d\/dd\u306a\u3069\uff09\u306e\u9055\u3044\u306f\uff1f<\/strong><br \/>\n      <span><br \/>\n        <strong>A.<\/strong> <strong>m<\/strong>\u306f\u300c1\u300d\u300c12\u300d\u306e\u3088\u3046\u306b\u53ef\u5909\u3001<strong>mm<\/strong>\u306f\u300c01\u300d\u300c12\u300d\u3068\u5fc5\u305a2\u6841\u3002\u30d5\u30a1\u30a4\u30eb\u540d\u7528\u9014\u306a\u3069\u6841\u3092\u63c3\u3048\u305f\u3044\u6642\u306f<strong>mm<\/strong>\u3084<strong>dd<\/strong>\u63a8\u5968\u3002<br \/>\n      <\/span>\n    <\/li>\n<li>\n      <strong>Q2. CDate\u3067\u610f\u56f3\u3057\u306a\u3044\u5e74\uff0829\u5e74\u21922029\u5e74\uff09\u304c\u51fa\u308b\u306e\u306f\uff1f<\/strong><br \/>\n      <span> <strong>A.<\/strong> 2\u6841\u5e74\u306e\u89e3\u91c8\u306f<strong>OS\u8a2d\u5b9a\u4f9d\u5b58<\/strong>\u3067\u3059\u3002\u300c2029\u5e74\u307e\u3067\u309221\u4e16\u7d00\u300d\u306a\u3069\u306e\u30ed\u30b8\u30c3\u30af\u306a\u306e\u3067\u3001\u5e74\u306f<strong>\u5fc5\u305a4\u6841<\/strong>\u3067\uff01 <\/span>\n    <\/li>\n<li>\n      <strong>Q3. ISO 8601\u5f62\u5f0f\uff08yyyy-mm-ddThh:mm:ss+09:00\uff09\u3067\u51fa\u529b\u3059\u308b\u306b\u306f\uff1f<\/strong><br \/>\n      <span> <strong>A.<\/strong> <strong>Format(Now, &#8220;yyyy-mm-dd&#8221;&#8221;T&#8221;&#8221;hh:mm:ss&#8221;) &#038; &#8220;+09:00&#8221;<\/strong> \u306e\u3088\u3046\u306b<strong>\u56fa\u5b9a\u6587\u5b57\u5217\u306f\u4e8c\u91cd\u5f15\u7528\u7b26\u3067\u631f\u307f\u307e\u3059<\/strong>\u3002 <\/span>\n    <\/li>\n<li>\n      <strong>Q4. Excel\u306e\u8868\u793a\u5f62\u5f0f\u3068VBA\u306e\u5909\u63db\u306e\u9055\u3044\u306f\uff1f<\/strong><br \/>\n      <span> <strong>A.<\/strong> Excel\u306e\u8868\u793a\u5f62\u5f0f\u306f\u201c\u898b\u305f\u76ee\u201d\u3060\u3051\u3092\u5909\u66f4\u3001\u672c\u4f53\u306f\u30b7\u30ea\u30a2\u30eb\u5024\u3002VBA\u306e<strong>Format<\/strong>\u306f\u3001<strong>\u672c\u5f53\u306b\u300c\u6587\u5b57\u5217\u300d\u306b\u5909\u63db<\/strong>\u3059\u308b\u70b9\u304c\u9055\u3044\u307e\u3059\u3002 <\/span>\n    <\/li>\n<li>\n      <strong>Q5. \u30eb\u30fc\u30d7\u3067\u6bce\u56deFormat\u3092\u547c\u3076\u3068\u9045\u304f\u306a\u308b\uff1f<\/strong><br \/>\n      <span> <strong>A.<\/strong> \u5927\u91cf\u51e6\u7406\u306a\u3089\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u3002\u5fdc\u7528\u7de8\u3067\u7d39\u4ecb\u3057\u305f<strong>\u914d\u5217<\/strong>\u30c6\u30af\u3067\u9ad8\u901f\u5316\u3057\u307e\u3057\u3087\u3046\u3002 <\/span>\n    <\/li>\n<\/ul>\n<hr \/>\n<h2>\u307e\u3068\u3081\u30fb\u4e00\u8a00<\/h2>\n<p>\n    \u65e5\u4ed8\u3068\u6587\u5b57\u5217\u5909\u63db\u306e<strong>\u4ed5\u7d44\u307f\u3068\u4f7f\u3044\u5206\u3051\u3001\u30a8\u30e9\u30fc\u306e\u56de\u907f\u6cd5<\/strong>\u3092\u62bc\u3055\u3048\u308c\u3070\u3001<br \/>\n    VBA\u306e\u5b9f\u52d9\u306f\u30b0\u30c3\u3068\u697d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u624b\u5143\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u30011\u3064\u3067\u3082\u52d5\u304b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\n  <\/p>\n<hr \/>\n<\/div>\n","protected":false},"featured_media":1836,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1835"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1836"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}