{"id":3203,"date":"2015-08-26T12:45:22","date_gmt":"2015-08-26T03:45:22","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=3203"},"modified":"2015-08-26T12:45:22","modified_gmt":"2015-08-26T03:45:22","slug":"cellreplace","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/cellreplace\/","title":{"rendered":"\u30bb\u30eb\u306e\u5024\u3092\u7f6e\u63db\uff08Replace \u30e1\u30bd\u30c3\u30c9\uff09"},"content":{"rendered":"<h2>Replace \u30e1\u30bd\u30c3\u30c9<\/h2>\n<div class=\"m30-l\">\n<p>\u4efb\u610f\u306e\u30bb\u30eb\u7bc4\u56f2\u5185\u304b\u3089\u7279\u5b9a\u306e\u5024\u3092\u4e00\u62ec\u3057\u3066\u7f6e\u63db\u3057\u307e\u3059\u3002<strong>Find \u30e1\u30bd\u30c3\u30c9<\/strong> \u540c\u69d8\u3001\u5f15\u6570 <em>lookat<\/em>\u3001<em>searchorder<\/em>\u3001<em>matchcase<\/em>\u3001<em>matchbyte<\/em> \u306e\u8a2d\u5b9a\u306f\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u305f\u3073\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\u6b21\u306b\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3059\u308b\u969b\u3001\u3053\u308c\u3089\u306e\u5f15\u6570\u306e\u6307\u5b9a\u3092\u7701\u7565\u3059\u308b\u3068\u3001\u4fdd\u5b58\u3055\u308c\u305f\u8a2d\u5b9a\u304c\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u307e\u305f\u3001\u3053\u308c\u3089\u306e\u8a2d\u5b9a\u306f\u3001[\u691c\u7d22\u3068\u7f6e\u63db] \u30c0\u30a4\u30a2\u30ed\u30b0\u30dc\u30c3\u30af\u30b9\u306b\u8868\u793a\u3055\u308c\u308b\u8a2d\u5b9a\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\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>lookat<\/em>, <em>searchorder<\/em>, <em>matchcase<\/em>, <em>matchbyte<\/em>, <em>searchformat<\/em>, <em>replaceformat<\/em> ] )<\/p><\/div>\n<br \/>\n<h3>\u5f15\u6570\u30fb\u623b\u308a\u5024<\/h3>\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>lookat&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u691c\u7d22\u6761\u4ef6\u3092\u8868\u3059\u5b9a\u6570\uff08XlLookAt \u5217\u6319\u578b\uff09\u307e\u305f\u306f\u3001\u305d\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffcc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffcc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffcc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\" >xlWhole<\/td>\n<td width=\"80\" align = \"center\">1<\/td>\n<td width=\"320\" >\u5b8c\u5168\u4e00\u81f4\u306e\u30bb\u30eb\u3092\u691c\u7d22<\/td>\n<\/tr>\n<tr>\n<td width=\"250\" >xlPart<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"320\" >\u691c\u7d22\u6587\u5b57\u5217\u3092\u542b\u3080\u30bb\u30eb\u3092\u691c\u7d22<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>searchorder&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u691c\u7d22\u6642\u306b\u7e26\u6a2a\u3069\u3061\u3089\u306e\u884c\u5217\u5358\u4f4d\u3068\u3057\u3066\u691c\u7d22\u3059\u308b\u304b\u3092\u8868\u3059\u5b9a\u6570\uff08XlSearchOrder \u5217\u6319\u578b\uff09\u307e\u305f\u306f\u3001\u305d\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"250\" bgcolor=\"#ffffcc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"80\" bgcolor=\"#ffffcc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"320\" bgcolor=\"#ffffcc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"250\" >xlByRows<\/td>\n<td width=\"80\" align = \"center\">1<\/td>\n<td width=\"320\" >\u884c\u3092\u6a2a\u65b9\u5411\u306b\u691c\u7d22\u3057\u3066\u304b\u3089\u3001\u6b21\u306e\u884c\u306b\u79fb\u52d5<\/td>\n<\/tr>\n<tr>\n<td width=\"250\" >xlByColumns<\/td>\n<td width=\"80\" align = \"center\">2<\/td>\n<td width=\"320\" >\u5217\u3092\u4e0b\u65b9\u5411\u306b\u691c\u7d22\u3057\u3066\u304b\u3089\u3001\u6b21\u306e\u5217\u306b\u79fb\u52d5<\/td>\n<\/tr>\n<\/table>\n<p>\n      <\/li>\n<li>matchcase&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3059\u308b\u5834\u5408\u306f\u3001<strong>True<\/strong> \u3092\u3001\u3057\u306a\u3044\u5834\u5408\u306f <strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65e2\u5b9a\u5024\u306f\u3001<strong>False<\/strong> \u3067\u3059\u3002<\/li>\n<li>matchbyte&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u534a\u89d2\u6587\u5b57\u3001\u5168\u89d2\u6587\u5b57\u3092\u533a\u5225\u3059\u308b\u5834\u5408\u306f\u3001<strong>True<\/strong> \u3092\u3001\u3057\u306a\u3044\u5834\u5408\u306f <strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65e2\u5b9a\u5024\u306f\u3001<strong>False<\/strong> \u3067\u3059\u3002<\/li>\n<li>searchformat&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<a href=\"https:\/\/excelwork.info\/excel\/vba_glossary\/#cellformat-object\">CellFormat \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/a> \u306b\u8a2d\u5b9a\u3055\u308c\u305f\u66f8\u5f0f\u3092\u691c\u7d22\u3059\u308b\u5834\u5408\u306f\u3001<strong>True<\/strong> \u3092\u3001\u3057\u306a\u3044\u5834\u5408\u306f\u3001<strong>False<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u65e2\u5b9a\u5024\u306f\u3001<strong>False<\/strong> \u3067\u3059\u3002<\/li>\n<li>replaceformat&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u66f8\u5f0f\u3092\u7f6e\u63db\u3059\u308b\u5834\u5408\u306f\u3001<strong>True<\/strong> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002\u7f6e\u63db\u5f8c\u306e\u66f8\u5f0f\u306f\u3001<strong>ReplaceFormat \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong> \u3067\u3001\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\">\u5f15\u6570 <em>what<\/em> \u306b\u306f\u3001\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\uff08\u300c?\u300d\u4efb\u610f\u306e 1 \u6587\u5b57\u3001\u300c*\u300d\u4efb\u610f\u306e 1 \u6587\u5b57\u4ee5\u4e0a\u306e\u6587\u5b57\u5217\uff09\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p class=\"caution4\">\u5404\u5f15\u6570\u306e\u5177\u4f53\u7684\u306a\u4f7f\u7528\u65b9\u6cd5\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/cellfind\/\">\u30bb\u30eb\u7bc4\u56f2\u5185\u3092\u691c\u7d22\uff08Find \u30e1\u30bd\u30c3\u30c9\uff09<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/p><\/div>\n<\/div>\n<br \/><br \/>\n<h2>Replace \u30e1\u30bd\u30c3\u30c9 \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=\"Replace \u30e1\u30bd\u30c3\u30c9 \u4f7f\u7528\u4f8b\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_Replace()\r\n\r\n    '\u300c\u5c71\u7530\u300d\u3092\u300c\u5e83\u702c\u300d\u306b\u7f6e\u63db\r\n    Cells.Replace what:=\"\u5c71\u7530\", replacement:=\"\u5e83\u702c\"\r\n\r\n    '\u300cA\u300d\u3092\u542b\u3080\u30bb\u30eb\u3092\u300cEEE\u300d\u306b\u7f6e\u63db\uff08\u300c*\u300d\u306f\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9\uff09\r\n    Range(\"C1:C11\").Replace \"A*\", \"EEE\"\r\n    \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\u30bd\u30fc\u30b9\u5b9f\u884c\u524d<\/p>\n<p><a href=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace01.jpg?ssl=1\" rel=\"lightbox[3203]\"><img loading=\"lazy\" src=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace01.jpg?resize=400%2C323&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 \u4f8b01\" width=\"400\" height=\"323\" class=\"alignnone size-medium wp-image-3206\" srcset=\"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace01.jpg?resize=400%2C323&amp;ssl=1 400w, https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace01.jpg?w=414&amp;ssl=1 414w\" 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\/cellreplace02.jpg?ssl=1\" rel=\"lightbox[3203]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace02.jpg?resize=400%2C323&#038;ssl=1\" alt=\"Replace \u30e1\u30bd\u30c3\u30c9 \u4f8b02\" width=\"400\" height=\"323\" class=\"alignnone size-medium wp-image-3207\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace02.jpg?resize=400%2C323&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace02.jpg?w=412&amp;ssl=1 412w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>Replace \u30e1\u30bd\u30c3\u30c9 \u4efb\u610f\u306e\u30bb\u30eb\u7bc4\u56f2\u5185\u304b\u3089\u7279\u5b9a\u306e\u5024\u3092\u4e00\u62ec\u3057\u3066\u7f6e\u63db\u3057\u307e\u3059\u3002Fi &#8230; <\/p>\n","protected":false},"author":1,"featured_media":3381,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[268],"tags":[270,518,63,38,269,211],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/08\/cellreplace01-400x3231.jpg?fit=400%2C323&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-PF","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3203"}],"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=3203"}],"version-history":[{"count":7,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3203\/revisions"}],"predecessor-version":[{"id":6655,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/3203\/revisions\/6655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/3381"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=3203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=3203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=3203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}