{"id":1566,"date":"2015-04-26T09:10:27","date_gmt":"2015-04-26T00:10:27","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1566"},"modified":"2015-04-26T09:27:57","modified_gmt":"2015-04-26T00:27:57","slug":"isnull","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/isnull\/","title":{"rendered":"\u5909\u6570\u304cNull \u5024\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\uff08 IsNull \u95a2\u6570 \uff09"},"content":{"rendered":"<h2>IsNull \u95a2\u6570\u306e\u4f7f\u3044\u65b9<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p><em>result<\/em> = <strong>IsNull<\/strong> ( <em>expression<\/em> )<\/p>\n<\/div>\n<br \/>\n<h3>\u3010\u5f15\u6570\u30fb\u623b\u308a\u5024\u3011<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>expression&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8abf\u3079\u308b\u5909\u6570\u3084\u5f0f<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f15\u6570 <em>expression<\/em> \u304c\u3001<strong>Null \u5024<\/strong>\u3092\u542b\u3093\u3067\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u8abf\u3079\u305f\u7d50\u679c<br \/>\uff08\u30d6\u30fc\u30eb\u578b\uff1a<span class=\"red\">Null \u5024\u3092\u542b\u3080\u5834\u5408\u306f\u3001<strong>True<\/strong> \uff0f \u305d\u3046\u3067\u306a\u3051\u308c\u3070\u3001<strong>False<\/strong><\/span> \uff09\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>\u5909\u6570\u304c Null \u5024<\/strong> \u3067\u3042\u308b\u5834\u5408\u3068\u306f\u3001\u6709\u52b9\u306a\u30c7\u30fc\u30bf\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u793a\u3059\u5024\u306e\u3053\u3068\u3067\u3059\u3002\u5909\u6570\u304c\u521d\u671f\u5316\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\uff08 <strong>Empty<\/strong> \uff09\u3001\u9577\u3055\u300c0\u300d\u306e\u6587\u5b57\u5217\uff08 <strong>Null\u6587\u5b57<\/strong> \uff09\u306e\u5834\u5408\u3068\u306f\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<p class=\"caution4\">\u5f15\u6570 <em>expression<\/em> \u304c\u8907\u6570\u306e\u5909\u6570\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u306e\u4e2d\u306e<span class=\"red\">\u5909\u6570\u304c\uff11\u3064\u3067\u3082 <strong>Null \u5024<\/strong>\u306e\u5834\u5408\u306f\u3001\u5f0f\u5168\u4f53\u304c <strong>Null \u5024<\/strong><\/span>\u3068\u306a\u308a\u307e\u3059\u3002\uff08\u203b\u3000\u305f\u3060\u3057\u3001\u300c\uff06\u300d\u6f14\u7b97\u5b50\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306f\u8907\u6570\u306e\u5909\u6570\u304c\u3042\u3063\u3066\u3082 Null \u5024\u3068\u306a\u3089\u306a\u3044\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002\u21d2 \u300c<a href=\"https:\/\/excelwork.info\/excel\/concatenation_operator\/\">VBA \u306e\u6f14\u7b97\u5b50\uff08\u6587\u5b57\u9023\u7d50\u6f14\u7b97\u5b50\uff1a&#038; \u6f14\u7b97\u5b50 + \u6f14\u7b97\u5b50\uff09<\/a>\u300d\u3092\u53c2\u7167\uff09<\/p>\n<p class=\"caution4\">If \u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u7b49\u3092\u4f7f\u3063\u3066\u3001<br \/>\n\u3000\u3000If <em>value<\/em> = Null then \u2026 <br \/>\n\u3000\u3000If <em>value<\/em> <> Null then \u2026<br \/>\n  \u3068\u3057\u305f\u5834\u5408\u3001\u3044\u305a\u308c\u306e\u5f0f\u3082 False\uff08\u507d\uff09\u3068\u8a55\u4fa1\u3055\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<span class=\"red\"><strong>\u3053\u308c\u306f Null \u5024\u3092\u542b\u3080\u5f0f\u306f\u3001\u5f0f\u81ea\u4f53\u304c Null \u5024\u3068\u306a\u308a\u3001\u507d (False) \u3068\u8a55\u4fa1\u3055\u308c\u308b\u305f\u3081\u3067\u3059<\/strong><\/span>\u3002<\/p>\n<\/div>\n<br \/>\n<h2>IsNull \u95a2\u6570\u306e\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff1c\u305d\u306e\uff11\uff1e<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"IsNull \u95a2\u6570\u306e\u4f7f\u7528\u4f8b\uff11\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_isnull01()\r\n\r\n    Dim myVal1, myVal2, myVal3, myVal4, myVal5, myVal6, myVal7\r\n\r\n    myVal2 = \"\"\r\n    myVal3 = 0\r\n    myVal4 = Empty\r\n    myVal5 = 123\r\n    myVal6 = \"\u3053\u3093\u3070\u3093\u306f\"\r\n    myVal7 = Null\r\n    \r\n    'False\r\n    Debug.Print IsNull(myVal1)\r\n    Debug.Print IsNull(myVal2)\r\n    Debug.Print IsNull(myVal3)\r\n    Debug.Print IsNull(myVal4)\r\n    Debug.Print IsNull(myVal5)\r\n    Debug.Print IsNull(myVal6)\r\n    \r\n    'True\r\n    Debug.Print IsNull(myVal7)\r\n    Debug.Print IsNull(myVal1 + myVal7)\r\n    Debug.Print IsNull(myVal2 + myVal7)\r\n    Debug.Print IsNull(myVal3 + myVal7)\r\n    Debug.Print IsNull(myVal4 + myVal7)\r\n    Debug.Print IsNull(myVal5 + myVal7)\r\n    Debug.Print IsNull(myVal6 + myVal7)\r\n    \r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c\uff08\u305d\u306e\uff11\uff09<\/h3>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01.jpg?ssl=1\" rel=\"lightbox[1566]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01.jpg?resize=400%2C248&#038;ssl=1\" alt=\"IsNull \u95a2\u6570\u3000\u4f8b\uff11\" width=\"400\" height=\"248\" class=\"alignnone size-medium wp-image-1569\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01.jpg?resize=400%2C248&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01.jpg?resize=580%2C359&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01.jpg?w=648&amp;ssl=1 648w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><br \/>\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9\uff1c\u305d\u306e\uff12\uff1e<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"IsNull \u95a2\u6570\u306e\u4f7f\u7528\u4f8b\uff12\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_isnull02()\r\n\r\n    'Null \u3092\u542b\u3080\u5f0f\u306f\u5168\u3066\u507d\uff08False\uff09\u3068\u306a\u308b\u305f\u3081\r\n    '\u30e1\u30c3\u30bb\u30fc\u30b8\u30dc\u30c3\u30af\u30b9\u306b\u306f\u3001\u300cccc\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002\r\n    \r\n    Dim myVal\r\n    \r\n    If myVal = Null Then\r\n        \r\n        MsgBox \"aaa\"\r\n    \r\n    ElseIf myVal <> Null Then\r\n    \r\n        MsgBox \"bbb\"\r\n    \r\n    Else\r\n    \r\n        MsgBox \"ccc\"\r\n    \r\n    End If\r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c\uff08\u305d\u306e\uff12\uff09<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull03.jpg?ssl=1\" rel=\"lightbox[1566]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull03.jpg?resize=154%2C178&#038;ssl=1\" alt=\"IsNull \u95a2\u6570\u3000\u4f8b\uff12\" width=\"154\" height=\"178\" class=\"alignnone size-full wp-image-1572\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>IsNull \u95a2\u6570\u306e\u4f7f\u3044\u65b9 \u3010\u66f8\u5f0f\u3011 result = IsNull ( exp &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1575,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":"\u5909\u6570\u304cNull \u5024\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\uff08 IsNull \u95a2\u6570 \uff09"},"categories":[37],"tags":[158,159,63,38,151,152],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/04\/isnull01-400x2481.jpg?fit=400%2C248&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-isnull","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1566"}],"collection":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/comments?post=1566"}],"version-history":[{"count":7,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1566\/revisions"}],"predecessor-version":[{"id":1577,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1566\/revisions\/1577"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1575"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}