{"id":1900,"date":"2015-05-18T10:37:36","date_gmt":"2015-05-18T01:37:36","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=1900"},"modified":"2015-08-26T01:27:20","modified_gmt":"2015-08-25T16:27:20","slug":"vartype","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/vartype\/","title":{"rendered":"\u30c7\u30fc\u30bf\u578b\u3092\u8abf\u3079\u3066\u3001\u305d\u306e\u30c7\u30fc\u30bf\u578b\u3092\u793a\u3059\u6570\u5024\u3092\u8fd4\u3059\uff08VarType \u95a2\u6570\uff09"},"content":{"rendered":"<h2>VarType \u95a2\u6570 \u306e\u4f7f\u3044\u65b9<\/h2>\n<br \/>\n<div class=\"m30-l\">\n<p><strong>VarType \u95a2\u6570<\/strong>\u306f\u3001\u5f15\u6570\u306b\u3001\u30c7\u30fc\u30bf\u578b\u3092\u8abf\u3079\u305f\u3044\u5024\u3084\u5909\u6570\u3092\u6307\u5b9a\u3059\u308b\u3068\u305d\u306e\u30c7\u30fc\u30bf\u578b\u3092\u793a\u3059\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p><em>result<\/em> = <strong>VarType<\/strong> ( <em>varname<\/em> )<\/p>\n<\/div>\n<br \/>\n<h3>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\n<ul style=\"margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;\">\n<li>varname&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8abf\u3079\u305f\u3044\u5024\u3084\u5909\u6570\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5f15\u6570 <em>varname<\/em> \u306e\u30c7\u30fc\u30bf\u578b\u3092\u8868\u3059\u6570\u5024<br \/>\uff08\u623b\u308a\u5024\u306f\u3001\u4ee5\u4e0b\u300cVarType \u95a2\u6570\u306e\u623b\u308a\u5024\u4e00\u89a7\u300d\u3092\u53c2\u7167\uff09\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>VarType \u95a2\u6570\u306e\u623b\u308a\u5024\u4e00\u89a7<\/strong><\/p>\n<div class=\"m30-l\">\n<table>\n<tr>\n<td align = \"center\" width=\"60\" bgcolor=\"#ffffcc\"><strong>\u623b\u308a\u5024<br \/>\uff08\u6570\u5024\uff09<\/strong><\/td>\n<td align = \"center\" width=\"100\" bgcolor=\"#ffffcc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffcc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">0<\/td>\n<td width=\"100\">vbEmpty<\/td>\n<td width=\"400\">Empty \u5024 (\u672a\u521d\u671f\u5316)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">1<\/td>\n<td width=\"100\">vbNull<\/td>\n<td width=\"400\">Null \u5024 (\u7121\u52b9\u306a\u5024)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">2<\/td>\n<td width=\"100\">vbInteger<\/td>\n<td width=\"400\">\u6574\u6570\u578b (Integer)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">3<\/td>\n<td width=\"100\">vbLong<\/td>\n<td width=\"400\">\u9577\u6574\u6570\u578b (Long)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">4<\/td>\n<td width=\"100\">vbSingle<\/td>\n<td width=\"400\">\u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u578b (Single)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">5<\/td>\n<td width=\"100\">vbDouble<\/td>\n<td width=\"400\">\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u6570\u578b (Double)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">6<\/td>\n<td width=\"100\">vbCurrency<\/td>\n<td width=\"400\">\u901a\u8ca8\u578b (Currency)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">7<\/td>\n<td width=\"100\">vbDate<\/td>\n<td width=\"400\">\u65e5\u4ed8\u578b (Date)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">8<\/td>\n<td width=\"100\">vbString<\/td>\n<td width=\"400\">\u6587\u5b57\u5217\u578b (String)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">9<\/td>\n<td width=\"100\">vbObject<\/td>\n<td width=\"400\">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">10<\/td>\n<td width=\"100\">vbError<\/td>\n<td width=\"400\">\u30a8\u30e9\u30fc\u5024<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">11<\/td>\n<td width=\"100\">vbBoolean<\/td>\n<td width=\"400\">\u30d6\u30fc\u30eb\u578b (Boolean)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">12<\/td>\n<td width=\"100\">vbVariant<\/td>\n<td width=\"400\">\u30d0\u30ea\u30a2\u30f3\u30c8\u578b (Variant) (\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\u914d\u5217\u306b\u306e\u307f\u4f7f\u7528)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">13<\/td>\n<td width=\"100\">vbDataObject<\/td>\n<td width=\"400\">\u975eOLE \u30aa\u30fc\u30c8\u30e1\u30fc\u30b7\u30e7\u30f3 \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">14<\/td>\n<td width=\"100\">vbDecimal<\/td>\n<td width=\"400\">10 \u9032\u6570\u578b<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">17<\/td>\n<td width=\"100\">vbByte<\/td>\n<td width=\"400\">\u30d0\u30a4\u30c8\u578b (Byte)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">20<\/td>\n<td width=\"100\">vbLongLong<\/td>\n<td width=\"400\">LongLong \u578b\u306e\u6574\u6570 <br \/>(64 \u30d3\u30c3\u30c8 \u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u4e0a\u3067\u306e\u307f\u6709\u52b9)<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">36<\/td>\n<td width=\"100\">vbUserDefinedType<\/td>\n<td width=\"400\">\u30e6\u30fc\u30b6\u30fc\u5b9a\u7fa9\u578b\u3092\u542b\u3080\u30d0\u30ea\u30a2\u30f3\u30c8\u578b<\/td>\n<\/tr>\n<tr>\n<td align = \"center\" width=\"60\">8192<\/td>\n<td width=\"100\">vbArray<\/td>\n<td width=\"400\">\u914d\u5217<\/td>\n<\/tr>\n<\/table>\n<\/div>\n<br \/><br \/>\n<p class=\"caution4\">\u5f15\u6570 <em>varname<\/em> \u304c\u3001<strong>\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\u5909\u6570<\/strong>\u306e\u5834\u5408\u306f\u3001\u5185\u90e8\u51e6\u7406\u5f62\u5f0f\u3092\u8b58\u5225\u3059\u308b\u6570\u5024\u3092\u8fd4\u3057\u307e\u3059\u3002\n<\/p>\n<p class=\"caution4\"><strong>VarType \u95a2\u6570<\/strong>\u306f\u3001<strong>\u5b9a\u6570 vbArray \u306e\u5024 (8192)<\/strong> \u3092\u5358\u72ec\u3067\u306f\u8fd4\u3057\u307e\u305b\u3093\u3002\u3053\u306e\u5024\u306f<span class=\"blue\">\u5e38\u306b\u30c7\u30fc\u30bf\u578b\u3092\u8868\u3059\u4ed6\u306e\u5024\u3068\u52a0\u7b97\u3055\u308c\u3066\u8fd4\u3055\u308c<\/span>\u3001\u6307\u5b9a\u3057\u305f\u5909\u6570\u304c\u305d\u306e\u30c7\u30fc\u30bf\u578b\u306e\u8981\u7d20\u3092\u6301\u3064\u914d\u5217\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002<br \/>\n\uff08\u4f8b\uff09\u6574\u6570\u578b\u306e\u8981\u7d20\u3092\u6301\u3064\u914d\u5217\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408<br \/>\n\u3000\u3000\u3000<span class=\"red\">vbInteger + vbArray<\/span> \u3068\u3057\u3066\u8a08\u7b97\u3055\u308c\u305f\u5024 <span class=\"red\">8194<\/span> \u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\n<\/p>\n<p class=\"caution4\"><strong>\u5b9a\u6570 vbVariant<\/strong> \u306f\u3001\u5e38\u306b<strong>\u5b9a\u6570 vbArray<\/strong> \u3068\u52a0\u7b97\u3055\u308c\u3066\u8fd4\u3055\u308c\u3001\u6307\u5b9a\u3057\u305f\u5909\u6570\u304c\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\u306e\u914d\u5217\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002 \u21d2 <span class=\"red\">vbVariant + vbArray<\/span> \u3068\u3057\u3066\u8a08\u7b97\u3055\u308c\u305f\u5024 <span class=\"red\">8204<\/span> \u304c\u8fd4\u3055\u308c\u307e\u3059\u3002\n<\/p>\n<\/div>\n<br \/><br \/>\n<h2>VarType \u95a2\u6570 \u306e\u4f7f\u7528\u4f8b<\/h2>\n<div class=\"m30-l\">\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"VarType \u95a2\u6570\u306e\u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_vartype()\r\n\r\n    Dim myStr As String, myInt As Integer, myLng As Long\r\n    Dim myDbl As Double, mySgl As Single, myBol As Boolean\r\n    Dim myObj As Object, myDat As Date, myCur As Currency\r\n    Dim myByt As Byte, myWks As Worksheet\r\n    Dim myVal1, myVal2, myEmp, myNull\r\n    Dim myArray1() As Variant, myArray2() As Long\r\n    \r\n    Set myWks = ActiveSheet\r\n    myVal1 = 123\r\n    myVal2 = CDec(12500)\r\n    myNull = Null\r\n    \r\n    Debug.Print VarType(myEmp)          'Empty\uff08\u672a\u5b9a\u7fa9\uff09\r\n    Debug.Print VarType(myNull)         'Null \u5024\r\n    Debug.Print VarType(myInt)          '\u6574\u6570\u578b\uff08Integer\uff09\r\n    Debug.Print VarType(myVal1)         '\u6574\u6570\u578b\uff08Integer\uff09\r\n    Debug.Print VarType(myLng)          '\u9577\u6574\u6570\u578b\uff08Long\uff09\r\n    Debug.Print VarType(mySgl)          '\u5358\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08Single\uff09\r\n    Debug.Print VarType(myDbl)          '\u500d\u7cbe\u5ea6\u6d6e\u52d5\u5c0f\u6570\u70b9\u578b\uff08Double\uff09\r\n    Debug.Print VarType(myCur)          '\u901a\u8ca8\u578b\uff08Currency\uff09\r\n    Debug.Print VarType(myDat)          '\u65e5\u4ed8\u578b\uff08Date\uff09\r\n    Debug.Print VarType(myStr)          '\u6587\u5b57\u5217\u578b\uff08String\uff09\r\n    Debug.Print VarType(myObj)          '\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\r\n    Debug.Print VarType(myWks)          '\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08WorkSheet\uff09\r\n    Debug.Print VarType(myBol)          '\u30d6\u30fc\u30eb\u578b\uff08Boolean\uff09\r\n    Debug.Print VarType(myVal2)         '10\u9032\u6570\u578b\r\n    Debug.Print VarType(myByt)          '\u30d0\u30a4\u30c8\u578b\uff08Byte\uff09\r\n    Debug.Print VarType(myArray1)       '\u914d\u5217\uff08\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\uff09\r\n    Debug.Print VarType(myArray2)       '\u914d\u5217\uff08\u9577\u6574\u6570\u578b\uff09\r\n\r\n\r\n    \r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype.jpg?ssl=1\" rel=\"lightbox[1900]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype.jpg?resize=400%2C235&#038;ssl=1\" alt=\"VarType \u95a2\u6570 \u4f8b\" width=\"400\" height=\"235\" class=\"alignnone size-medium wp-image-1905\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype.jpg?resize=400%2C235&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype.jpg?resize=580%2C341&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype.jpg?w=872&amp;ssl=1 872w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/><\/div>\n<br \/><br \/>\n","protected":false},"excerpt":{"rendered":"<p>VarType \u95a2\u6570 \u306e\u4f7f\u3044\u65b9 VarType \u95a2\u6570\u306f\u3001\u5f15\u6570\u306b\u3001\u30c7\u30fc\u30bf\u578b\u3092\u8abf\u3079\u305f &#8230; <\/p>\n","protected":false},"author":1,"featured_media":1922,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[37],"tags":[250,63,38,248,249],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/05\/vartype-400x2351.jpg?fit=400%2C235&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-vartype","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1900"}],"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=1900"}],"version-history":[{"count":8,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1900\/revisions"}],"predecessor-version":[{"id":3365,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/1900\/revisions\/3365"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/1922"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=1900"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=1900"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=1900"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}