{"id":2856,"date":"2013-04-07T22:08:34","date_gmt":"2013-04-07T13:08:34","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=2856"},"modified":"2013-04-07T22:08:34","modified_gmt":"2013-04-07T13:08:34","slug":"%e3%83%aa%e3%83%9c%e3%83%b3%e3%83%bb%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%9e%e3%82%a4%e3%82%ba%e3%82%a2%e3%82%af%e3%83%86%e3%82%a3%e3%83%96%e3%82%b7%e3%83%bc%e3%83%88%e3%81%ab%e3%82%88%e3%82%8a%e8%a1%a8","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=2856","title":{"rendered":"[\u30ea\u30dc\u30f3\u30fb\u30ab\u30b9\u30bf\u30de\u30a4\u30ba]\u30a2\u30af\u30c6\u30a3\u30d6\u30b7\u30fc\u30c8\u306b\u3088\u308a\u8868\u793a\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3092\u5207\u308a\u66ff\u3048\u308b\u3002"},"content":{"rendered":"<p>Excel\u3067\u3001\u9078\u629e\u3057\u3066\u3044\u308b\u30b7\u30fc\u30c8\u306b\u3088\u3063\u3066\u8868\u793a\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3092\u5207\u308a\u66ff\u3048\u305f\u3044\u3068\u3044\u3046\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u306e\u3067\u51e6\u7406\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u30ea\u30dc\u30f3XML\uff1a<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;\r\n&lt;customUI onLoad=&quot;ThisWorkbook.Ribbon_onLoad&quot; xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSample&quot; label=&quot;Sample Tab&quot;&gt;\r\n        &lt;group id=&quot;grpSample1&quot; label=&quot;Sample Group1&quot; getVisible=&quot;ThisWorkbook.group_getVisible&quot; tag=&quot;1&quot;&gt;\r\n          &lt;button id=&quot;btnSample1&quot; label=&quot;Sample Button1&quot; size=&quot;large&quot; imageMso=&quot;HappyFace&quot; \/&gt;\r\n          &lt;button id=&quot;btnSample2&quot; label=&quot;Sample Button2&quot; size=&quot;large&quot; imageMso=&quot;HappyFace&quot; \/&gt;\r\n          &lt;button id=&quot;btnSample3&quot; label=&quot;Sample Button3&quot; size=&quot;large&quot; imageMso=&quot;HappyFace&quot; \/&gt;\r\n        &lt;\/group&gt;\r\n      &lt;group id=&quot;grpSample2&quot; label=&quot;Sample Group2&quot; getVisible=&quot;ThisWorkbook.group_getVisible&quot; tag=&quot;2&quot;&gt;\r\n          &lt;button id=&quot;btnSample4&quot; label=&quot;Sample Button4&quot; size=&quot;large&quot; imageMso=&quot;SadFace&quot; \/&gt;\r\n          &lt;button id=&quot;btnSample5&quot; label=&quot;Sample Button5&quot; size=&quot;large&quot; imageMso=&quot;SadFace&quot; \/&gt;\r\n          &lt;button id=&quot;btnSample6&quot; label=&quot;Sample Button6&quot; size=&quot;large&quot; imageMso=&quot;SadFace&quot; \/&gt;\r\n        &lt;\/group&gt;\r\n      &lt;\/tab&gt;\r\n    &lt;\/tabs&gt;\r\n  &lt;\/ribbon&gt;\r\n&lt;\/customUI&gt;<\/pre>\n<p><strong>VBA\u30b3\u30fc\u30c9(ThisWorkbook)\uff1a<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate myRibbon As Office.IRibbonUI\r\nPrivate flg(1 To 2) As Boolean\r\n\r\nPublic Sub Ribbon_onLoad(ribbon As IRibbonUI)\r\n  Set myRibbon = ribbon\r\n  Select Case LCase$(ActiveWorkbook.ActiveSheet.Name)\r\n    Case &quot;sheet1&quot;\r\n      flg(1) = True\r\n      flg(2) = False\r\n    Case &quot;sheet2&quot;\r\n      flg(1) = False\r\n      flg(2) = True\r\n    Case Else\r\n      flg(1) = True\r\n      flg(2) = True\r\n  End Select\r\nEnd Sub\r\n\r\nPublic Sub group_getVisible(control As IRibbonControl, ByRef returnedVal)\r\n  returnedVal = flg(CLng(control.Tag))\r\nEnd Sub\r\n\r\nPrivate Sub Workbook_SheetActivate(ByVal Sh As Object)\r\n  Select Case LCase$(Sh.Name)\r\n    Case &quot;sheet1&quot;\r\n      flg(1) = True\r\n      flg(2) = False\r\n    Case &quot;sheet2&quot;\r\n      flg(1) = False\r\n      flg(2) = True\r\n    Case Else\r\n      flg(1) = True\r\n      flg(2) = True\r\n  End Select\r\n  myRibbon.Invalidate\r\nEnd Sub<\/pre>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01-300x186.png\" alt=\"\" title=\"grp_getVisible_01\" width=\"300\" height=\"186\" class=\"alignnone size-medium wp-image-2857\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01-300x186.png 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01-290x180.png 290w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01-150x93.png 150w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/grp_getVisible_01.png 637w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f\u3001Sheet1\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u3068\u304d\u306f&#8221;<strong>grpSample1<\/strong>&#8220;\u304c\u3001Sheet2\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u3068\u304d\u306f&#8221;<strong>grpSample2<\/strong>&#8220;\u3001\u305d\u308c\u4ee5\u5916\u306e\u30b7\u30fc\u30c8\u306e\u6642\u306f&#8221;<strong>grpSample1<\/strong>&#8220;\u3068&#8221;<strong>grpSample2<\/strong>&#8220;\u306e\u4e21\u65b9\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u3001<span style=\"color: #ff0000; font-weight: bold;\">getVisible<\/span>\u5c5e\u6027\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30a2\u30af\u30c6\u30a3\u30d6\u30b7\u30fc\u30c8\u306b\u9650\u3089\u305a\u3001\u4f55\u3089\u304b\u306e\u6761\u4ef6\u3067\u30ea\u30dc\u30f3\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u3092\u5207\u308a\u66ff\u3048\u305f\u3044\u5834\u5408\u306b\u306f\u4fbf\u5229\u306a\u51e6\u7406\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"Excel\u3067\u3001\u9078\u629e\u3057\u3066\u3044\u308b\u30b7\u30fc\u30c8\u306b\u3088\u3063\u3066\u8868\u793a\u3059\u308b\u30b0\u30eb\u30fc\u30d7\u3092\u5207\u308a\u66ff\u3048\u305f\u3044\u3068\u3044\u3046\u8cea\u554f\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u306e\u3067\u51e6\u7406\u3092\u8003\u3048\u3066\u307f\u307e\u3057\u305f\u3002 \u30ea\u30dc\u30f3XML\uff1a &lt;?xml version=&quot;1.0&quot; encodin [&hellip;]","protected":false},"author":1,"featured_media":7130,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4,1],"tags":[7,11,12],"class_list":["post-2856","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-ribbon","tag-ribbon-2","tag-office-2","tag-12"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Ribbon.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-K4","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2856","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=2856"}],"version-history":[{"count":5,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2856\/revisions"}],"predecessor-version":[{"id":2862,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2856\/revisions\/2862"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7130"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}