{"id":2526,"date":"2015-07-11T08:04:25","date_gmt":"2015-07-10T23:04:25","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=2526"},"modified":"2015-08-23T08:28:15","modified_gmt":"2015-08-22T23:28:15","slug":"celltext","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/celltext\/","title":{"rendered":"\u30bb\u30eb\u306e\u6587\u5b57\u5217\u3092\u53d6\u5f97\uff08Text \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>Text \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<p>\u30bb\u30eb\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<strong>Text \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u306f\u3001\u53d6\u5f97\u306e\u307f\u3067\u3001\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>result<\/em> = <em>Object<\/em>.<strong>Text<\/strong><\/p><\/div>\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>object&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5bfe\u8c61\u3068\u306a\u308b <span class=\"red\"><strong>Range \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u6307\u5b9a\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30bb\u30eb\uff09\u306b\u8868\u793a\u3055\u308c\u308b\u6587\u5b57\u5217\uff08\u5185\u90e8\u51e6\u7406\u5f62\u5f0f String \u306e\u30d0\u30ea\u30a2\u30f3\u30c8\u578b\uff09<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>Value \u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u306e\u9055\u3044\u306b\u3064\u3044\u3066<\/strong><br \/>\n    <span class=\"red\"><strong>Value \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u306f\u3001\u7d14\u7c8b\u306a\u5024\u3084\u6570\u5f0f\u306e\u8a08\u7b97\u7d50\u679c\u3092\u53d6\u5f97<\/span>\u3057\u307e\u3059\u3002<br \/>\n    <span class=\"red\"><strong>Text \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u306f\u3001\u30bb\u30eb\u306e <strong>\u898b\u305f\u76ee\u306e\u5024<\/strong> \u3092\u53d6\u5f97<\/span>\u3057\u307e\u3059\u3002\u6570\u5024\u3084\u65e5\u4ed8\u306a\u3069\u306b\u66f8\u5f0f\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u305d\u306e\u30bb\u30eb\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u305d\u306e\u307e\u307e\u53d6\u5f97\u3057\u307e\u3059\u3002\u307e\u305f\u3001\u30bb\u30eb\u5e45\u304c\u72ed\u304f\u3066\u8868\u793a\u3057\u304d\u308c\u306a\u3044\u5834\u5408\u7b49\u3001\u300c####\u300d\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u300c####\u300d\u3082 <strong>Text \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>Text \u30d7\u30ed\u30d1\u30c6\u30a3 \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=\"Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Text()\r\n\r\n    Dim myRng, v, str\r\n    Set myRng = Range(\"A2:F2\")\r\n    \r\n    For Each v In myRng\r\n        \r\n        str = str & \"Value\uff1a\" & v.Value & Chr(9) & \"Text\uff1a\" & v.Text & Chr(9) & \"Formula\uff1a\" & v.Formula & Chr(13)\r\n    \r\n    Next v\r\n\r\n    MsgBox str\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\/07\/celltext01.jpg?ssl=1\" rel=\"lightbox[2526]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/celltext01.jpg?resize=400%2C243&#038;ssl=1\" alt=\"Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b\" width=\"400\" height=\"243\" class=\"alignnone size-medium wp-image-2527\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/celltext01.jpg?resize=400%2C243&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/celltext01.jpg?resize=580%2C352&amp;ssl=1 580w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/celltext01.jpg?w=696&amp;ssl=1 696w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 2<\/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=\"Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 2\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample02_Text()\r\n\r\n    '\u30bb\u30eb\u5e45\u304c\u72ed\u304f\u6570\u5024\u7b49\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u306a\u3044\uff08### \u306a\u3069\u8868\u793a\uff09\u5834\u5408\u3092\r\n    '\u5224\u5b9a\u3057\u3001\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u3002\r\n    '\u5224\u5b9a\u65b9\u6cd5\u306f\u3001\u30bb\u30eb\u5e45\u304c\u72ed\u304f# \u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3001Value\u5024\u306f\u3001\u6570\u5024\u3084\u65e5\u4ed8\u3092\u3001\r\n    'Text\u5024\u306f\u3001\u30bb\u30eb\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3067\u304d\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u5229\u7528\u3002\r\n    \r\n    '\u203b \u30a8\u30e9\u30fc\u3084\u300c#\u300d\u3067\u59cb\u307e\u308b\u6587\u5b57\u5217\u7b49\u306f\u3001\u7121\u8996\r\n    \r\n    Dim myRng As Range, i As Long, Fsize As Integer\r\n    Set myRng = Range(\"B3:E10\")\r\n    \r\n    For i = 1 To myRng.Count\r\n    \r\n        '\u6570\u5f0f\u30a8\u30e9\u30fc\u4ee5\u5916\r\n        If Not IsError(myRng(i).Value) Then\r\n        \r\n            '\u300c#\u300d\u304b\u3089\u59cb\u307e\u308a\u3001Value\u5024\u3068Text\u5024\u304c\u7570\u306a\u308b\r\n            If Left(myRng(i).Text, 1) = \"#\" And myRng(i).Value <> myRng(i).Text Then\r\n                \r\n                '\u7e2e\u5c0f\u8868\u793a\r\n                myRng(i).ShrinkToFit = True\r\n                \r\n            End If\r\n        \r\n        End If\r\n    \r\n    Next i\r\n                    \r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_1.jpg?ssl=1\" rel=\"lightbox[2526]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_1.jpg?resize=400%2C270&#038;ssl=1\" alt=\"Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b2_1\" width=\"400\" height=\"270\" class=\"alignnone size-medium wp-image-3235\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_1.jpg?resize=400%2C270&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_1.jpg?w=572&amp;ssl=1 572w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_2.jpg?ssl=1\" rel=\"lightbox[2526]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_2.jpg?resize=400%2C268&#038;ssl=1\" alt=\"Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b2_2\" width=\"400\" height=\"268\" class=\"alignnone size-medium wp-image-3237\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_2.jpg?resize=400%2C268&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/text_p_ex02_2.jpg?w=571&amp;ssl=1 571w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>Text \u30d7\u30ed\u30d1\u30c6\u30a3 \u30bb\u30eb\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002Text \u30d7\u30ed\u30d1\u30c6 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2568,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[270,374,63,38,269,375],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/celltext01-400x2431.jpg?fit=400%2C243&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/s4Ye9i-celltext","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2526"}],"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=2526"}],"version-history":[{"count":6,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2526\/revisions"}],"predecessor-version":[{"id":3239,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2526\/revisions\/3239"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/2568"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=2526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=2526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=2526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}