{"id":2632,"date":"2015-07-19T11:20:53","date_gmt":"2015-07-19T02:20:53","guid":{"rendered":"http:\/\/excelwork.info\/excel\/?p=2632"},"modified":"2015-10-21T09:35:49","modified_gmt":"2015-10-21T00:35:49","slug":"colorindexcolors","status":"publish","type":"post","link":"https:\/\/excelwork.info\/excel\/colorindexcolors\/","title":{"rendered":"\u8272\u306e\u8a2d\u5b9a\uff08ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \u30d7\u30ed\u30d1\u30c6\u30a3\uff09"},"content":{"rendered":"<h2>ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<p><strong>ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u306f\u3001\u6307\u5b9a\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e<strong>\u8272<\/strong>\u3092\u53d6\u5f97\u30fb\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u8a2d\u5b9a\u306b\u306f\u3001<strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8<\/strong>\u306e<strong>\u30d1\u30ec\u30c3\u30c8\u756a\u53f7<\/strong>\u3092\u4f7f\u3063\u3066\u8272\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>result<\/em> = <em>Object<\/em>.<strong>ColorIndex<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u8a2d\u5b9a\uff1e<\/strong><\/span><br \/>\n    <em>Object<\/em>.<strong>ColorIndex<\/strong> = <em>index<\/em><\/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>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n      <strong>Border \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u7f6b\u7dda\uff09<\/strong>\u3001<strong>Borders \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u8f2a\u90ed\u7dda\uff09<\/strong>\u3001<strong>Font \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u6587\u5b57\uff09<\/strong>\u3001<strong>Interior \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08\u30bb\u30eb\uff09<\/strong>\u3001<strong>FormatColor\uff08\u30ab\u30e9\u30fc\u30b9\u30b1\u30fc\u30eb\uff09<\/strong> \u306a\u3069<\/li>\n<li>index&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8<\/strong>\u306e\u8272\u3092\u8868\u3059 <strong>1 \uff5e 56 \u306e\u30d1\u30ec\u30c3\u30c8\u756a\u53f7<\/strong>\u3001\u307e\u305f\u306f\u3001<strong>XlColorIndex \u5217\u6319\u578b<\/strong> \u306e\u5b9a\u6570\u307e\u305f\u306f\u305d\u306e\u5024\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n<table>\n<tr>\n<td align = \"center\" width=\"200\" bgcolor=\"#ffffccc\"><strong>\u5b9a\u6570<\/strong><\/td>\n<td align = \"center\" width=\"50\" bgcolor=\"#ffffccc\"><strong>\u5024<\/strong><\/td>\n<td align = \"center\" width=\"400\" bgcolor=\"#ffffccc\"><strong>\u5185\u5bb9<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"200\">xlColorIndexAutomatic<\/td>\n<td width=\"50\" align = \"center\">-4105<\/td>\n<td width=\"400\">\u81ea\u52d5\u8a2d\u5b9a<\/td>\n<\/tr>\n<tr>\n<td width=\"200\">xlColorIndexNone<\/td>\n<td width=\"50\" align = \"center\">-4142<\/td>\n<td width=\"400\">\u8272\u306a\u3057<\/td>\n<\/tr>\n<\/table>\n<p>\n    <\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b<strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8<\/strong>\u306e<strong>\u30d1\u30ec\u30c3\u30c8\u756a\u53f7<\/strong>\u3002<\/li>\n<\/ul>\n<\/div>\n<br \/><br \/>\n<h2>Colors \u30d7\u30ed\u30d1\u30c6\u30a3<\/h2>\n<div class=\"m30-l\">\n<p>Excel \u306f\u3001\u30d6\u30c3\u30af\u3054\u3068\u306b\u7ba1\u7406\u3067\u304d\u308b<strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8<\/strong>\u3092\u6301\u3063\u3066\u304a\u308a\u300156\u7a2e\u985e\u306e\u8272\u3092\u4fdd\u6301\u3057\u3066\u3044\u307e\u3059\u3002<strong>Colors \u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\u306f\u3001\u305d\u306e56\u7a2e\u985e\u306e\u8272\u306e\u8a2d\u5b9a\u3001\u53d6\u5f97\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<br \/>\n<div class=\"kkbox\"><strong>\u3010\u66f8\u5f0f\u3011<\/strong><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u53d6\u5f97\uff1e<\/strong><\/span><br \/>\n    <em>result<\/em> = <em>Object<\/em>.<strong>Colors<\/strong> ( <em>index<\/em> )<\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u8a2d\u5b9a\uff1e<\/strong><\/span><br \/>\n    <em>Object<\/em>.<strong>Colors<\/strong> ( <em>index<\/em> ) = <em>rgb<\/em><\/p>\n<p>    <span class=\"red\"><strong>\uff1c\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u3092\u30ea\u30bb\u30c3\u30c8\uff1e<\/strong><\/span><br \/>\n    <em>Object<\/em>.<strong>ResetColors<\/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>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><\/span>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>index&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;<strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8<\/strong>\u306e\u8272\u3092\u8868\u3059 <strong>1 \uff5e 56 \u306e\u30d1\u30ec\u30c3\u30c8\u756a\u53f7<\/strong>\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/li>\n<li>rgb&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8272\u3092\u8868\u3059 <strong>RGB \u5024<\/strong>\u3092\u6307\u5b9a\u3057\u307e\u3059\uff08 \u21d2 RGB \u5024\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/excelwork.info\/excel\/rgbxlrgbcolor\/\">RGB \u5024\u4e00\u89a7\u8868<\/a> \u3092\u53c2\u7167\uff09\u3002\u307e\u305f\u3001<a href=\"https:\/\/excelwork.info\/excel\/colorrgb\/\">RGB \u95a2\u6570<\/a> \u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/li>\n<li>result&nbsp;&nbsp;\u30fb\u30fb\u30fb&nbsp;&nbsp;\u8272\u3092\u8868\u3059 <strong>RGB \u5024<\/strong>\u3002<\/li>\n<\/ul>\n<br \/>\n<p class=\"caution4\"><strong>\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u306e\u30ea\u30bb\u30c3\u30c8<\/strong><br \/>\n    <strong>Workbook \u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\u306e<strong>ResetColors \u30e1\u30bd\u30c3\u30c9<\/strong>\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3055\u308c\u305f\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u306f\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u3066\u3001<strong>\u65e2\u5b9a\u306e\u72b6\u614b<\/strong>\u306b\u623b\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n<br \/><br \/>\n<h2>ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \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\u30b91<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 1\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ColorIndex1()\r\n\r\n    Dim myRng As Range\r\n    Dim i, v\r\n    \r\n    Set myRng = Range(\"A1:G8\")\r\n    i = 1\r\n\r\n    '\u73fe\u5728\u306e\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u306e\u72b6\u614b\u3092\u3092\u30b7\u30fc\u30c8\u4e0a\u306b\u8868\u793a\r\n    For Each v In myRng\r\n\r\n        v.Interior.ColorIndex = i\r\n        i = i + 1\r\n\r\n    Next v\r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 1<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011.jpg?ssl=1\" rel=\"lightbox[2632]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011.jpg?resize=400%2C219&#038;ssl=1\" alt=\"ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \u30d7\u30ed\u30d1\u30c6\u30a3\u3000\u4f8b01\" width=\"400\" height=\"219\" class=\"alignnone size-medium wp-image-2636\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011.jpg?resize=400%2C219&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011.jpg?resize=580%2C318&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011.jpg?w=613&amp;ssl=1 613w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<br \/>\n<h3 id=\"vba_sample\">\u30b5\u30f3\u30d7\u30ebVBA\u30bd\u30fc\u30b92<\/h3>\n<pre class=\"lang:vb mark:0 decode:true \" title=\"ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \u30d7\u30ed\u30d1\u30c6\u30a3 \u4f7f\u7528\u4f8b 2\" data-url=\"http:\/\/example.co.jp\" >\r\n\u3000\r\nSub Sample_ColorIndex2()\r\n\r\n    'Book1.xls \u306e\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u3092\u30b3\u30d4\u30fc\r\n    ThisWorkbook.Colors = Workbooks(\"Book1.xlsm\").Colors\r\n            \r\n    '\u30ab\u30e9\u30fc\u30d1\u30ec\u30c3\u30c8\u3092\u30ea\u30bb\u30c3\u30c8\r\n    'ThisWorkbook.ResetColors\r\n\r\nEnd Sub\r\n\u3000\r\n<\/pre>\n<br \/>\n<h3>\u5b9f\u884c\u7d50\u679c 2<\/h3>\n<p><a href=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors02.jpg?ssl=1\" rel=\"lightbox[2632]\"><img loading=\"lazy\" src=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors02.jpg?resize=400%2C217&#038;ssl=1\" alt=\"ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u30fbColors \u30d7\u30ed\u30d1\u30c6\u30a3\u3000\u4f8b02\" width=\"400\" height=\"217\" class=\"alignnone size-medium wp-image-2637\" srcset=\"https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors02.jpg?resize=400%2C217&amp;ssl=1 400w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors02.jpg?resize=580%2C315&amp;ssl=1 580w, https:\/\/i0.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors02.jpg?w=612&amp;ssl=1 612w\" sizes=\"(max-width: 400px) 100vw, 400px\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<\/div>\n<br \/>\n","protected":false},"excerpt":{"rendered":"<p>ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3 ColorIndex \u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u3001\u6307\u5b9a\u3057\u305f\u30aa &#8230; <\/p>\n","protected":false},"author":1,"featured_media":2701,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"amp_status":"","spay_email":"","jetpack_publicize_message":""},"categories":[37],"tags":[411,412,63,363,38],"jetpack_featured_media_url":"https:\/\/i1.wp.com\/excelwork.info\/excel\/wp\/wp-content\/uploads\/2015\/07\/colorindexcolors011-400x2191.jpg?fit=400%2C219&ssl=1","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4Ye9i-Gs","_links":{"self":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2632"}],"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=2632"}],"version-history":[{"count":7,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2632\/revisions"}],"predecessor-version":[{"id":4120,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/posts\/2632\/revisions\/4120"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media\/2701"}],"wp:attachment":[{"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/media?parent=2632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/categories?post=2632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/excelwork.info\/excel\/wp-json\/wp\/v2\/tags?post=2632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}