{"id":3770,"date":"2013-11-20T15:49:27","date_gmt":"2013-11-20T06:49:27","guid":{"rendered":"http:\/\/www.ka-net.org\/blog\/?p=3770"},"modified":"2013-11-20T15:49:27","modified_gmt":"2013-11-20T06:49:27","slug":"%e3%82%af%e3%82%a4%e3%83%83%e3%82%af-%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9-%e3%83%84%e3%83%bc%e3%83%ab%e3%83%90%e3%83%bc%e3%81%8b%e3%82%89%e8%a1%a8%e7%a4%ba%e4%b8%ad%e3%81%ae%e3%83%96%e3%83%83%e3%82%af","status":"publish","type":"post","link":"https:\/\/www.ka-net.org\/blog\/?p=3770","title":{"rendered":"\u30af\u30a4\u30c3\u30af \u30a2\u30af\u30bb\u30b9 \u30c4\u30fc\u30eb\u30d0\u30fc\u304b\u3089\u8868\u793a\u4e2d\u306e\u30d6\u30c3\u30af\u306b\u3042\u308b\u30b7\u30fc\u30c8\u3092\u9078\u629e\u8868\u793a\u3059\u308bExcel\u30a2\u30c9\u30a4\u30f3"},"content":{"rendered":"<p><a href=\"http:\/\/www.ex-it-blog.com\/\" title=\"EX-IT\" target=\"_blank\">Excel MVP\u306e\u4e95\u30ce\u4e0a\u3055\u3093\u306e\u30d6\u30ed\u30b0<\/a>\u306b\u9762\u767d\u3044\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><strong>\u30fbExcel\u3067\u76ee\u6b21\uff08\u30b7\u30fc\u30c8\u3078\u306e\u30ea\u30f3\u30af\uff09\u3092\u4f5c\u308b\u30de\u30af\u30ed | EX-IT<\/strong><br \/>\n<a href=\"http:\/\/www.ex-it-blog.com\/131119Excel-sheet-mokuji-macro\" title=\"Excel\u3067\u76ee\u6b21\uff08\u30b7\u30fc\u30c8\u3078\u306e\u30ea\u30f3\u30af\uff09\u3092\u4f5c\u308b\u30de\u30af\u30ed | EX-IT\" target=\"_blank\">http:\/\/www.ex-it-blog.com\/131119Excel-sheet-mokuji-macro<\/a><\/p>\n<p>\u30cf\u30a4\u30d1\u30fc\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u8a72\u5f53\u30b7\u30fc\u30c8\u304c\u8868\u793a\u3055\u308c\u308b\u3001&#8221;<strong>\u30b7\u30fc\u30c8\u306e\u76ee\u6b21<\/strong>&#8220;\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3068\u305d\u306e\u30de\u30af\u30ed\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b7\u30fc\u30c8\u6570\u304c\u591a\u3044\u5834\u5408\u306b\u306f\u76ee\u6b21\u304c\u3042\u308b\u3068\u3068\u3066\u3082\u4fbf\u5229\u3067\u3059\u306d\u3002<\/p>\n<p>\u4e95\u30ce\u4e0a\u3055\u3093\u306e\u3053\u306e\u8a18\u4e8b\u306b\u523a\u6fc0\u3092\u53d7\u3051\u3066\u3001\u79c1\u306e\u65b9\u3067\u3082&#8221;<strong>\u30af\u30a4\u30c3\u30af \u30a2\u30af\u30bb\u30b9 \u30c4\u30fc\u30eb\u30d0\u30fc\u304b\u3089\u8868\u793a\u4e2d\u306e\u30d6\u30c3\u30af\u306b\u3042\u308b\u30b7\u30fc\u30c8\u3092\u9078\u629e\u8868\u793a\u3059\u308bExcel\u30a2\u30c9\u30a4\u30f3<\/strong>&#8220;\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u30a2\u30c9\u30a4\u30f3\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9:<a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelectorQAT.zip\" target=\"_blank\">SheetSelectorQAT.zip<\/a><\/p>\n<p>\u4e0a\u8a18Zip\u30d5\u30a1\u30a4\u30eb\u3092\u89e3\u51cd\u5f8c\u3001\u30a2\u30c9\u30a4\u30f3\u30d5\u30a1\u30a4\u30eb(<strong>SheetSelector.xlam<\/strong>)\u3092Excel\u306e\u30a2\u30c9\u30a4\u30f3\u30d5\u30a9\u30eb\u30c0\u306b\u30b3\u30d4\u30fc\u3057\u3066(\u540c\u68b1\u306e<span style=\"color: #ff0000; font-weight: bold;\">\u30a2\u30c9\u30a4\u30f3\u30d5\u30a9\u30eb\u30c0\u3092\u958b\u304f.vbs<\/span>\u3092\u5b9f\u884c\u3059\u308b\u3068\u81ea\u52d5\u7684\u306b\u30a2\u30c9\u30a4\u30f3\u30d5\u30a9\u30eb\u30c0\u304c\u958b\u304d\u307e\u3059)\u30aa\u30d7\u30b7\u30e7\u30f3\u753b\u9762\u304b\u3089\u30a2\u30c9\u30a4\u30f3\u3092\u8aad\u307f\u8fbc\u3080\u3068\u3001\u30af\u30a4\u30c3\u30af\u30a2\u30af\u30bb\u30b9\u30c4\u30fc\u30eb\u30d0\u30fc\u306b\u300c<span style=\"color: #ff0000; font-weight: bold;\">\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u9078\u629e<\/span>\u300d\u30e1\u30cb\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_01-300x232.png\" alt=\"SheetSelector_01\" width=\"300\" height=\"232\" class=\"alignnone size-medium wp-image-3771\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_01-300x232.png 300w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_01.png 497w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3053\u306e\u30e1\u30cb\u30e5\u30fc\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u9078\u629e\u3057\u305f\u540d\u524d\u306e\u30b7\u30fc\u30c8\u304c\u9078\u629e\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30de\u30a6\u30b9\u30af\u30ea\u30c3\u30af\u306f\u3082\u3061\u308d\u3093\u3067\u3059\u304c\u3001\u30a2\u30af\u30bb\u30b9\u30ad\u30fc(Alt + \u6570\u5b57\u30ad\u30fc)\u304b\u3089\u3067\u3082\u30b7\u30fc\u30c8\u3092\u9078\u629e\u3067\u304d\u308b\u306e\u3067\u3001\u30ad\u30fc\u30dc\u30fc\u30c9\u3067Excel\u3092\u64cd\u4f5c\u3057\u3066\u3044\u308b\u65b9\u306b\u306f\u3053\u3061\u3089\u306e\u65b9\u304c\u304a\u85a6\u3081\u3067\u3059\u3002<\/p>\n<p><a href=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_02-244x300.png\" alt=\"SheetSelector_02\" width=\"244\" height=\"300\" class=\"alignnone size-medium wp-image-3772\" srcset=\"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_02-244x300.png 244w, https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/SheetSelector_02.png 318w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/a><\/p>\n<p>\u307e\u305f\u3001\u5f53\u30a2\u30c9\u30a4\u30f3\u306eVBA\u30b3\u30fc\u30c9\u3068\u30ea\u30dc\u30f3XML\u306f\u4e0b\u8a18\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u5f53\u30c4\u30fc\u30eb\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u65b9\u306f\u4e0b\u8a18\u30b3\u30fc\u30c9\u3092\u3054\u5229\u7528\u304f\u3060\u3055\u3044(InvalidateControl\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u30a4\u30d9\u30f3\u30c8\u306f\u9069\u5f53\u306b\u8a2d\u5b9a\u3057\u3066\u3042\u308b\u306e\u3067\u3001\u6c17\u306b\u306a\u308b\u65b9\u306f\u4fee\u6b63\u3057\u3066\u30a2\u30c9\u30a4\u30f3\u3092\u304a\u4f7f\u3044\u304f\u3060\u3055\u3044)\u3002<\/p>\n<p><strong>\u30fbVBA\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">Option Explicit\r\n\r\nPrivate myRibbon As Office.IRibbonUI\r\nPrivate WithEvents App As Excel.Application\r\n\r\nPublic Sub rbnSheetSelector_onLoad(ribbon As IRibbonUI)\r\n  Set myRibbon = ribbon\r\n  Set App = Application\r\nEnd Sub\r\n\r\nPrivate Sub App_WorkbookActivate(ByVal Wb As Workbook)\r\n  myRibbon.InvalidateControl &quot;dnmSheetSelector&quot;\r\nEnd Sub\r\n\r\nPrivate Sub App_WorkbookDeactivate(ByVal Wb As Workbook)\r\n  myRibbon.InvalidateControl &quot;dnmSheetSelector&quot;\r\nEnd Sub\r\n\r\nPrivate Sub App_WorkbookOpen(ByVal Wb As Workbook)\r\n  myRibbon.InvalidateControl &quot;dnmSheetSelector&quot;\r\nEnd Sub\r\n\r\nPrivate Sub App_SheetActivate(ByVal Sh As Object)\r\n  myRibbon.InvalidateControl &quot;dnmSheetSelector&quot;\r\nEnd Sub\r\n\r\nPublic Sub btnSheetSelector_onAction(control As IRibbonControl)\r\n  On Error Resume Next\r\n  ActiveWorkbook.Worksheets(CLng(control.Tag)).Select\r\n  If Err.Number &lt;&gt; 0 Then MsgBox &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; &quot;\u30a8\u30e9\u30fc\u5185\u5bb9:&quot; &amp; Err.Description, vbExclamation + vbSystemModal\r\n  On Error GoTo 0\r\nEnd Sub\r\n\r\nPublic Sub dnmSheetSelector_getContent(control As IRibbonControl, ByRef returnedVal)\r\n  Dim ws As Excel.Worksheet\r\n  Dim d As Object\r\n  Dim elmMenu As Object\r\n  Dim elmButton As Object\r\n  Dim i As Long, j As Long\r\n  \r\n  i = 0: j = 1 '\u521d\u671f\u5316\r\n  If App.Workbooks.Count &lt; 1 Then Exit Sub\r\n  On Error Resume Next\r\n  Set d = CreateObject(&quot;MSXML2.DOMDocument&quot;)\r\n  Set elmMenu = d.createElement(&quot;menu&quot;)\r\n  elmMenu.setAttribute &quot;xmlns&quot;, &quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot;\r\n  elmMenu.setAttribute &quot;itemSize&quot;, &quot;normal&quot;\r\n  For Each ws In ActiveWorkbook.Worksheets\r\n    If ws.Visible = xlSheetVisible Then\r\n      If j &gt; 9 Then j = 1\r\n      Set elmButton = d.createElement(&quot;button&quot;)\r\n      elmButton.setAttribute &quot;id&quot;, &quot;btnSheetName&quot; &amp; CStr(i)\r\n      elmButton.setAttribute &quot;label&quot;, ws.Name &amp; &quot;(&quot; &amp; ChrW(38) &amp; CStr(j) &amp; &quot;)&quot;\r\n      elmButton.setAttribute &quot;imageMso&quot;, &quot;FileNew&quot;\r\n      elmButton.setAttribute &quot;supertip&quot;, ws.Parent.FullName\r\n      elmButton.setAttribute &quot;tag&quot;, ws.Index\r\n      elmButton.setAttribute &quot;onAction&quot;, &quot;ThisWorkbook.btnSheetSelector_onAction&quot;\r\n      elmMenu.appendChild elmButton\r\n      Set elmButton = Nothing\r\n      i = i + 1\r\n      j = j + 1\r\n    End If\r\n  Next\r\n  d.appendChild elmMenu\r\n  returnedVal = d.XML\r\n  If Err.Number &lt;&gt; 0 Then MsgBox &quot;\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002&quot; &amp; vbCrLf &amp; &quot;\u30a8\u30e9\u30fc\u5185\u5bb9:&quot; &amp; Err.Description, vbExclamation + vbSystemModal\r\n  On Error GoTo 0\r\nEnd Sub<\/pre>\n<p><strong>\u30fb\u30ea\u30dc\u30f3XML<\/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 xmlns=&quot;http:\/\/schemas.microsoft.com\/office\/2006\/01\/customui&quot; onLoad=&quot;ThisWorkbook.rbnSheetSelector_onLoad&quot;&gt;\r\n  &lt;ribbon&gt;\r\n    &lt;tabs&gt;\r\n      &lt;tab id=&quot;tabSheetSelector&quot; label=&quot;SheetSelector Tab&quot; visible=&quot;false&quot;&gt;\r\n        &lt;group id=&quot;grpSheetSelector&quot; label=&quot;SheetSelector Group&quot;&gt;\r\n          &lt;dynamicMenu id=&quot;dnmSheetSelector&quot; imageMso=&quot;SelectSheet&quot; label=&quot;\u30ef\u30fc\u30af\u30b7\u30fc\u30c8\u9078\u629e&quot; supertip=&quot;\u73fe\u5728\u8868\u793a\u4e2d\u306e\u30ef\u30fc\u30af\u30d6\u30c3\u30af\u306b\u3042\u308b\u30b7\u30fc\u30c8\u3092\u9078\u629e\u3057\u307e\u3059\u3002&quot; size=&quot;large&quot; getContent=&quot;ThisWorkbook.dnmSheetSelector_getContent&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","protected":false},"excerpt":{"rendered":"Excel MVP\u306e\u4e95\u30ce\u4e0a\u3055\u3093\u306e\u30d6\u30ed\u30b0\u306b\u9762\u767d\u3044\u8a18\u4e8b\u304c\u3042\u308a\u307e\u3057\u305f\u3002 \u30fbExcel\u3067\u76ee\u6b21\uff08\u30b7\u30fc\u30c8\u3078\u306e\u30ea\u30f3\u30af\uff09\u3092\u4f5c\u308b\u30de\u30af\u30ed | EX-IT http:\/\/www.ex-it-blog.com\/131119Excel-sheet [&hellip;]","protected":false},"author":1,"featured_media":7111,"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,48],"tags":[],"class_list":["post-3770","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office","category-excel-office"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.ka-net.org\/blog\/wp-content\/uploads\/eyecatch-Excel.png","jetpack_shortlink":"https:\/\/wp.me\/p4UZZr-YO","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3770","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=3770"}],"version-history":[{"count":2,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3770\/revisions"}],"predecessor-version":[{"id":3775,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3770\/revisions\/3775"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=\/wp\/v2\/media\/7111"}],"wp:attachment":[{"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ka-net.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}