{"id":5072,"date":"2014-11-17T16:07:08","date_gmt":"2014-11-17T07:07:08","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=5072"},"modified":"2014-11-17T16:07:08","modified_gmt":"2014-11-17T07:07:08","slug":"unicode%e3%83%96%e3%83%ad%e3%83%83%e3%82%af%e3%82%92%e5%85%83%e3%81%ab%e6%8c%87%e5%ae%9a%e3%81%97%e3%81%9f%e6%96%87%e5%ad%97%e3%81%8c%e5%b9%b3%e4%bb%ae%e5%90%8d%e3%81%aa%e3%81%ae%e3%81%8b%e3%82%ab","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=5072","title":{"rendered":"Unicode\u30d6\u30ed\u30c3\u30af\u3092\u5143\u306b\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u5e73\u4eee\u540d\u306a\u306e\u304b\u30ab\u30bf\u30ab\u30ca\u306a\u306e\u304b\u6f22\u5b57\u306a\u306e\u304b\u3092\u5224\u5225\u3059\u308bVBA\u30de\u30af\u30ed"},"content":{"rendered":"<p>\u4ee5\u524d\u66f8\u3044\u305f\u300c<a href=\"\/\/www.ka-net.org\/blog\/?p=4562\" title=\"\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed\" target=\"_blank\">\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed<\/a>\u300d\u8a18\u4e8b\u3067\u4f7f\u3063\u305f\u3001<span style=\"color: #ff0000; font-weight: bold;\">\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u6f22\u5b57\u306a\u306e\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u30de\u30af\u30ed<\/span>\u306b\u3001<span style=\"color: #ff0000; font-weight: bold;\">\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u5e73\u4eee\u540d\u306a\u306e\u304b\u30ab\u30bf\u30ab\u30ca\u306a\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u30de\u30af\u30ed<\/span>\u3082\u4ed8\u3051\u52a0\u3048\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPublic Sub Sample()\r\n  Dim s As String, tp As String, msg As String\r\n  Dim i As Long\r\n  Const str As String = &quot;\u3090\u3069\u306e\u30f0a\ufa23\u30e1\u7956\u30ec\u30f1\u3048\u3078b\u3091\u30af\u30f0\u30e3\u6e6e\u30a6c\u30ee\u30f4\u633dZ&quot;\r\n  \r\n  For i = 1 To Len(str)\r\n    s = Mid(str, i, 1)\r\n    If IsHiragana(s) = True Then\r\n      tp = &quot;\u3072\u3089\u304c\u306a&quot;\r\n    ElseIf IsKatakana(s) = True Then\r\n      tp = &quot;\u30ab\u30bf\u30ab\u30ca&quot;\r\n    ElseIf IsKanji(s) = True Then\r\n      tp = &quot;\u6f22\u5b57&quot;\r\n    Else\r\n      tp = &quot;\u305d\u306e\u4ed6&quot;\r\n    End If\r\n    If i = 1 Then\r\n      msg = &quot;\u300c&quot; &amp; s &amp; &quot;\u300d\u306f\u3010&quot; &amp; tp &amp; &quot;\u3011\u3067\u3059\u3002&quot;\r\n    Else\r\n      msg = msg &amp; vbCrLf &amp; &quot;\u300c&quot; &amp; s &amp; &quot;\u300d\u306f\u3010&quot; &amp; tp &amp; &quot;\u3011\u3067\u3059\u3002&quot;\r\n    End If\r\n  Next\r\n  MsgBox msg\r\nEnd Sub\r\n\r\nPrivate Function IsHiragana(ByVal char As String) As Boolean\r\n'\u3072\u3089\u304c\u306a\u5224\u5225\r\n  Dim cc As Variant\r\n  Dim ret As Boolean\r\n  \r\n  ret = True '\u521d\u671f\u5316\r\n  cc = Val(&quot;&amp;H&quot; &amp; Hex(AscW(char)) &amp; &quot;&amp;&quot;)\r\n  Select Case cc\r\n    Case 12352 To 12447 '\u3072\u3089\u304c\u306a(U+3040-U+309F)\r\n    Case Else\r\n      ret = False\r\n  End Select\r\n  IsHiragana = ret\r\nEnd Function\r\n\r\nPrivate Function IsKatakana(ByVal char As String) As Boolean\r\n'\u30ab\u30bf\u30ab\u30ca\u5224\u5225\r\n  Dim cc As Variant\r\n  Dim ret As Boolean\r\n  \r\n  ret = True '\u521d\u671f\u5316\r\n  cc = Val(&quot;&amp;H&quot; &amp; Hex(AscW(char)) &amp; &quot;&amp;&quot;)\r\n  Select Case cc\r\n    Case 12448 To 12543 '\u30ab\u30bf\u30ab\u30ca(U+30A0-U+30FF)\r\n    Case Else\r\n      ret = False\r\n  End Select\r\n  IsKatakana = ret\r\nEnd Function\r\n\r\nPrivate Function IsKanji(ByVal char As String) As Boolean\r\n'\u6f22\u5b57\u5224\u5225\r\n  Dim cc As Variant\r\n  Dim ret As Boolean\r\n  \r\n  ret = True '\u521d\u671f\u5316\r\n  cc = Val(&quot;&amp;H&quot; &amp; Hex(AscW(char)) &amp; &quot;&amp;&quot;)\r\n  Select Case cc\r\n    Case 19968 To 40959   'CJK\u7d71\u5408\u6f22\u5b57(U+4E00-U+9FFF)\r\n    Case 13312 To 19903   'CJK\u7d71\u5408\u6f22\u5b57\u62e1\u5f35A(U+3400-U+4DBF)\r\n    Case 131072 To 173791 'CJK\u7d71\u5408\u6f22\u5b57\u62e1\u5f35B(U+20000-U+2A6DF)\r\n    Case 173824 To 177983 'CJK\u7d71\u5408\u6f22\u5b57\u62e1\u5f35C(U+2A700-U+2B73F)\r\n    Case 177984 To 178207 'CJK\u7d71\u5408\u6f22\u5b57\u62e1\u5f35D(U+2B740-U+2B81F)\r\n    Case 63744 To 64255   'CJK\u4e92\u63db\u6f22\u5b57(U+F900-U+FAFF)\r\n    Case 194560 To 195103 'CJK\u4e92\u63db\u6f22\u5b57\u88dc\u52a9(U+2F800-U+2FA1F)\r\n    Case Else\r\n      ret = False\r\n  End Select\r\n  IsKanji = ret\r\nEnd Function<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsKanaKanji_01.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsKanaKanji_01.jpg\" alt=\"IsKanaKanji_01\" width=\"223\" height=\"592\" class=\"alignnone size-full wp-image-5073\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsKanaKanji_01.jpg 223w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/IsKanaKanji_01-113x300.jpg 113w\" sizes=\"auto, (max-width: 223px) 100vw, 223px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/ja-jp\/library\/gg264313.aspx\" title=\"Asc \u95a2\u6570\" target=\"_blank\">AscW\u95a2\u6570<\/a>\u3067\u6587\u5b57\u30b3\u30fc\u30c9\u3092\u8abf\u3079\u3066\u3001\u305d\u306e\u30b3\u30fc\u30c9\u304c\u5e73\u4eee\u540d\u306a\u306e\u304b\u30ab\u30bf\u30ab\u30ca\u306a\u306e\u304b\u6f22\u5b57\u306a\u306e\u304b\u3092\u8abf\u3079\u308b\u3068\u3044\u3046\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30de\u30af\u30ed\u3067\u3059\u3002<\/p>\n<p>\u6b63\u898f\u8868\u73fe\u3067\u3082\u6587\u5b57\u306e\u7a2e\u985e\u3092\u5224\u5225\u3067\u304d\u307e\u3059\u304c\u3001\u4eca\u56de\u306fSelect Case\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h4>\u25a0 \u53c2\u8003Web\u30da\u30fc\u30b8<\/h4>\n<ul>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Hiragana_%28Unicode_block%29\" title=\"Hiragana (Unicode block) - Wikipedia, the free encyclopedia\" target=\"_blank\">Hiragana (Unicode block) &#8211; Wikipedia, the free encyclopedia<\/a><\/li>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/Katakana_%28Unicode_block%29\" title=\"Katakana (Unicode block) - Wikipedia, the free encyclopedia\" target=\"_blank\">Katakana (Unicode block) &#8211; Wikipedia, the free encyclopedia<\/a><\/li>\n<li><a href=\"http:\/\/en.wikipedia.org\/wiki\/CJK_Unified_Ideographs_%28Unicode_block%29\" title=\"CJK Unified Ideographs (Unicode block) - Wikipedia, the free encyclopedia\" target=\"_blank\">CJK Unified Ideographs (Unicode block) &#8211; Wikipedia, the free encyclopedia<\/a><\/li>\n<li><a href=\"http:\/\/www.taishukan.co.jp\/kokugo\/webkoku\/series003_04.html\" title=\"\u65e5\u672c\u306e\u6587\u5b57\u3068Unicode\u3000\u7b2c4\u56de | \u5927\u4fee\u9928\u66f8\u5e97\u3000WEB\u56fd\u8a9e\u6559\u5ba4\" target=\"_blank\">\u65e5\u672c\u306e\u6587\u5b57\u3068Unicode\u3000\u7b2c4\u56de | \u5927\u4fee\u9928\u66f8\u5e97\u3000WEB\u56fd\u8a9e\u6559\u5ba4<\/a><\/li>\n<li><a href=\"http:\/\/www.asahi-net.or.jp\/~ax2s-kmtn\/ref\/unicode\/e_asia.html\" title=\"Unicode\uff08\u6771\u30a2\u30b8\u30a2\uff09 - CyberLibrarian\" target=\"_blank\">Unicode\uff08\u6771\u30a2\u30b8\u30a2\uff09 &#8211; CyberLibrarian<\/a><\/li>\n<li><a href=\"http:\/\/www.gsid.nagoya-u.ac.jp\/ohna\/notes\/nu\/regex4kanji2.txt\" title=\"Re: EmEditor\u3067\u306e\u6f22\u5b57\u4e00\u5b57\" target=\"_blank\">Re: EmEditor\u3067\u306e\u6f22\u5b57\u4e00\u5b57<\/a><\/li>\n<li><a href=\"http:\/\/support.microsoft.com\/kb\/161304\/ja\" title=\"16 \u9032\u6570\u5024\u3092\u9577\u6574\u6570\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5\" target=\"_blank\">16 \u9032\u6570\u5024\u3092\u9577\u6574\u6570\u306b\u5909\u63db\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"\u4ee5\u524d\u66f8\u3044\u305f\u300c\u30eb\u30d3(\u3075\u308a\u304c\u306a)\u3092\u4e00\u62ec\u8a2d\u5b9a\u3059\u308bWord\u30de\u30af\u30ed\u300d\u8a18\u4e8b\u3067\u4f7f\u3063\u305f\u3001\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u6f22\u5b57\u306a\u306e\u304b\u3069\u3046\u304b\u3092\u5224\u5225\u3059\u308b\u30de\u30af\u30ed\u306b\u3001\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u5e73\u4eee\u540d\u306a\u306e\u304b\u30ab\u30bf\u30ab\u30ca\u306a\u306e\u304b\u3092\u5224\u5225\u3059\u308b\u30de\u30af\u30ed\u3082\u4ed8\u3051\u52a0\u3048\u3066\u307f\u307e\u3057\u305f\u3002 Option Ex [&hellip;]","protected":false},"author":1,"featured_media":7111,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"\u3044\u3064\u304b\u4f7f\u3046\u304b\u3082\u3057\u308c\u306a\u3044\u30de\u30af\u30ed\u3067\u3059\u3002 [Unicode\u30d6\u30ed\u30c3\u30af\u3092\u5143\u306b\u6307\u5b9a\u3057\u305f\u6587\u5b57\u304c\u5e73\u4eee\u540d\u306a\u306e\u304b\u30ab\u30bf\u30ab\u30ca\u306a\u306e\u304b\u6f22\u5b57\u306a\u306e\u304b\u3092\u5224\u5225\u3059\u308bVBA\u30de\u30af\u30ed]","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,48,49,58],"tags":[],"class_list":["post-5072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office","category-word-office","category-powerpoint"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-1jO","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5072"}],"version-history":[{"count":1,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5072\/revisions"}],"predecessor-version":[{"id":5074,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/5072\/revisions\/5074"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}