{"id":3211,"date":"2015-08-27T08:24:31","date_gmt":"2015-08-26T23:24:31","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3211"},"modified":"2015-10-19T09:29:24","modified_gmt":"2015-10-19T00:29:24","slug":"cellreplacereplaceformat","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/cellreplacereplaceformat\/","title":{"rendered":"\u30bb\u30eb\u306e\u5024\u3092\u7f6e\u63db\u30fb\u66f8\u5f0f\u8a2d\u5b9a\uff08Replace \u30e1\u30bd\u30c3\u30c9,ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>\u30bb\u30eb\u306e\u5024\u306e\u7f6e\u63db\u3068\u66f8\u5f0f\u8a2d\u5b9a<\/h2>\n<div class=\"m30-l\">\n<p>\u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30bb\u30eb\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u307e\u305a\u3001<strong>Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong> \u306e <strong>ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u8a2d\u5b9a\u3059\u308b\u66f8\u5f0f\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001<strong>Replace \u30e1\u30bd\u30c3\u30c9<\/strong>\u3092\u3001\u5f15\u6570 <em>replaceformat<\/em> \u306b <strong>True<\/strong> \u3092\u8a2d\u5b9a\u3057\u3001\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n    <span class=\"red\">\u3053\u306e\u5834\u5408\u3001\u7f6e\u63db\u3059\u308b\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\u3059\u308b\u3001\u5f15\u6570 <em>replacement<\/em> \u306b\u300c&#8221;&#8221;\u300d\uff08\u7a7a\u767d\u6587\u5b57\u5217\uff09\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5024\u306e\u7f6e\u63db\u306f\u884c\u308f\u308c\u305a\u3001\u66f8\u5f0f\u306e\u307f\u5909\u66f4\u3055\u308c\u307e\u3059\u3002<\/span><br \/>\n    \u66f8\u5f0f\u3092\u5b9a\u7fa9\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/rangeborders\/\">Borders \u30d7\u30ed\u30d1\u30c6\u30a3<\/a>\u3001<a href=\"https:\/\/excelwork.info\/excel\/fontsetting\/\">Font \u30d7\u30ed\u30d1\u30c6\u30a3<\/a>\u3001\u307e\u305f\u306f <a href=\"https:\/\/excelwork.info\/excel\/cellinterior\/\">Interior \u30d7\u30ed\u30d1\u30c6\u30a3<\/a> \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<h3>Replace \u30e1\u30bd\u30c3\u30c9<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>Replace<\/strong> ( <em>what<\/em>, <em>replacement<\/em> [, <em>replaceformat<\/em> ] )<\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\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>what&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u691c\u7d22\u3059\u308b\u6587\u5b57\u5217\u3001\u5024\u306a\u3069\u3001\u30bb\u30eb\u5185\u306e\u30c7\u30fc\u30bf\u306b\u8a72\u5f53\u3059\u308b\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u4e0d\u53ef\u3002<\/li>\n<li>replacement&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u7f6e\u304d\u63db\u3048\u308b\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7701\u7565\u4e0d\u53ef\u3002<\/li>\n<li>replaceformat&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3059\u308b\u5834\u5408\u3001<strong>True<\/strong> \u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u30d6\u30fc\u30eb\u578b\uff08Boolean\uff09\u306e\u5024\uff08\u57fa\u672c\u7684\u306b\u3001<strong>True<\/strong> \uff09\u3092\u8fd4\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\">\u691c\u7d22\u30fb\u7f6e\u63db\u6761\u4ef6\u3092\u3055\u3089\u306b\u7d30\u304b\u304f\u6307\u5b9a\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/cellreplace\/\">\u30bb\u30eb\u306e\u5024\u3092\u7f6e\u63db\uff08Replace \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/p><\/div>\n<br \/>\n<h3 id=\"f-format\">ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3<\/h3>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <em>object<\/em>.<strong>ReplaceFormat<\/strong><\/p><\/div>\n<br \/>\n<h4>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h4>\n<div class=\"m30-l\">\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>Application \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>\u623b\u308a\u5024&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u7f6e\u63db\u5f8c\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3059\u308b <strong>CellFormat \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u3002\uff08CellFormat \u578b\uff09<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>ReplaceFormat.Clear \u30e1\u30bd\u30c3\u30c9<\/strong><br \/>\n      <strong>FindFormat \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u540c\u69d8\u3001\u3001\u66f8\u5f0f\u8a2d\u5b9a\u3059\u308b\u524d\u306b\u3001<span class=\"red\"><strong>Clear \u30e1\u30bd\u30c3\u30c9<\/strong> \u3092\u4f7f\u3063\u3066\u521d\u671f\u5316\u3092\u3057\u307e\u3059<\/span>\u3002\u3053\u308c\u3092\u3057\u306a\u3044\u3068\u524d\u306b\u8a2d\u5b9a\u3057\u305f\u6761\u4ef6\u304c\u91cd\u306a\u308a\u3001\u610f\u56f3\u3057\u305f\u7d50\u679c\u306b\u306a\u3089\u306a\u3044\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n      \u3000\u3000<br \/>\n      \u3000\uff08\u4f8b\uff09\u3000<strong>Application<\/strong>.<strong>ReplaceFormat<\/strong>.<strong>Clear<\/strong>\n    <\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Replace \u30e1\u30bd\u30c3\u30c9,ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 1<\/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=\"Replace \u30e1\u30bd\u30c3\u30c9,ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 1\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample01_ReplaceFormat()\r\n\r\n    '\u7f6e\u63db\u5f8c\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\uff08\u30bb\u30eb\u80cc\u666f\u8272\u3092\u5909\u66f4\uff09\r\n    With Application.ReplaceFormat\r\n        .Clear\r\n        .Interior.Color = rgbChartreuse\r\n    End With\r\n\r\n    '\u300cEEE\u300d\u3092\u300cAAA\u300d\u306b\u5909\u66f4\u3057\u3001\u66f8\u5f0f\u3082\u5909\u66f4\u3059\u308b\r\n    Cells.Replace _\r\n                    What:=\"EEE\", _\r\n                    Replacement:=\"AAA\", _\r\n                    LookAt:=xlWhole, _\r\n                    SearchOrder:=xlByRows, _\r\n                    MatchCase:=False, _\r\n                    MatchByte:=False, _\r\n                    SearchFormat:=False, _\r\n                    ReplaceFormat:=True\r\n\r\n\r\n\r\n    '\u7f6e\u63db\u5f8c\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\uff08\u30d5\u30a9\u30f3\u30c8\u306e\u592a\u3055\u3001\u8272\u3092\u5909\u66f4\uff09\r\n    With Application.ReplaceFormat\r\n        .Clear\r\n        .Font.Bold = True\r\n        .Font.Color = rgbCrimson\r\n    End With\r\n    \r\n\r\n    '\u300c\u5e83\u300d\u304b\u3089\u59cb\u307e\u308b\u6587\u5b57\u5217\u306b\u5f53\u3066\u306f\u307e\u308b\u30bb\u30eb\u306e\u66f8\u5f0f\u3092\u5909\u66f4\r\n    ' \u5f15\u6570 Replacement \u306b\u3001\"\"\uff08\u7a7a\u6587\u5b57\u5217\uff09\u3092\u6307\u5b9a\uff08\u66f8\u5f0f\u306e\u307f\u306e\u5909\u66f4\u3067\u3001\u6587\u5b57\u5217\u7f6e\u63db\u306f\u884c\u308f\u306a\u3044\uff09\r\n    Cells.Replace _\r\n                    What:=\"\u5e83*\", _\r\n                    Replacement:=\"\", _\r\n                    LookAt:=xlWhole, _\r\n                    SearchOrder:=xlByRows, _\r\n                    MatchCase:=False, _\r\n                    MatchByte:=False, _\r\n                    SearchFormat:=False, _\r\n                    ReplaceFormat:=True\r\n                                 \r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 1<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01.jpg?ssl=1\" rel=\"lightbox[3211]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01.jpg?resize=400%2C207&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b01\" width=\"400\" height=\"207\" class=\"alignnone size-medium wp-image-3213\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01.jpg?resize=400%2C207&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01.jpg?resize=580%2C301&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01.jpg?w=650&amp;ssl=1 650w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?ssl=1\" rel=\"lightbox[3211]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=400%2C205&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b02\" width=\"400\" height=\"205\" class=\"alignnone size-medium wp-image-3214\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=400%2C205&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=580%2C298&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?w=651&amp;ssl=1 651w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/><br \/>\n<h2>Replace \u30e1\u30bd\u30c3\u30c9,ReplaceFormat \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=\"Replace \u30e1\u30bd\u30c3\u30c9,ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 2\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample02_ReplaceFormat()\r\n\r\n    '\u691c\u7d22\u3059\u308b\u66f8\u5f0f\u306e\u8a2d\u5b9a\r\n    With Application.FindFormat\r\n        .Clear\r\n        .Font.Color = rgbRed\r\n    End With\r\n\r\n    '\u7f6e\u63db\u5f8c\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\uff08\u30d5\u30a9\u30f3\u30c8\u306e\u592a\u3055\u3001\u8272\u3092\u5909\u66f4\uff09\r\n    With Application.ReplaceFormat\r\n        .Clear\r\n        .Font.Bold = True\r\n        .Font.Name = \"AR P\u30b4\u30b7\u30c3\u30af\u4f53S\"\r\n        .Font.Size = 16\r\n        .Interior.Color = rgbPowderBlue\r\n    End With\r\n    \r\n\r\n    '\u66f8\u5f0f\u3092\u7f6e\u63db\r\n    Cells.Replace _\r\n                    What:=\"*\", _\r\n                    Replacement:=\"\", _\r\n                    LookAt:=xlWhole, _\r\n                    SearchFormat:=True, _\r\n                    ReplaceFormat:=True\r\n\r\nEnd Sub\r\n\u3000\r\n  <\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 2<\/h3>\n<p>\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b9 \u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?ssl=1\" rel=\"lightbox[3211]\"><img loading=\"lazy\" src=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=400%2C205&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b02\" width=\"400\" height=\"205\" class=\"alignnone size-medium wp-image-3214\" srcset=\"https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=400%2C205&amp;ssl=1 400w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?resize=580%2C298&amp;ssl=1 580w, https:\/\/i2.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat02.jpg?w=651&amp;ssl=1 651w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>\u5b9f\u884c\u5f8c<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat03.jpg?ssl=1\" rel=\"lightbox[3211]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat03.jpg?resize=400%2C206&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f8b03\" width=\"400\" height=\"206\" class=\"alignnone size-medium wp-image-3215\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat03.jpg?resize=400%2C206&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat03.jpg?resize=580%2C299&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat03.jpg?w=650&amp;ssl=1 650w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30bb\u30eb\u306e\u5024\u306e\u7f6e\u63db\u3068\u66f8\u5f0f\u8a2d\u5b9a \u691c\u7d22\u6761\u4ef6\u306b\u4e00\u81f4\u3059\u308b\u30bb\u30eb\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3059\u308b\u306b\u306f\u3001\u307e\u305a\u3001Ap &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3393,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[301,515,270,518,519,63,38,269,520],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplaceformat01-400x2071.jpg?fit=400%2C207&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-PN","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3211"}],"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=3211"}],"version-history":[{"count":6,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3211\/revisions"}],"predecessor-version":[{"id":4094,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3211\/revisions\/4094"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3393"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}