{"id":3824,"date":"2020-10-30T16:02:48","date_gmt":"2020-10-30T07:02:48","guid":{"rendered":"https:\/\/okamurax.com\/?p=3824"},"modified":"2021-07-03T09:21:21","modified_gmt":"2021-07-03T00:21:21","slug":"vba-%e8%b5%b7%e5%8b%95%e9%83%a8%e5%88%86%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88","status":"publish","type":"post","link":"https:\/\/appbay.org\/?p=3824","title":{"rendered":"VBA \u8d77\u52d5\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8"},"content":{"rendered":"<p>\u3044\u3064\u3082\u5fd8\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u30e1\u30e2\u3002<\/p>\n<p>\u53f3\u30af\u30ea\u30c3\u30af\u30e1\u30cb\u30e5\u30fc\u306e\u968e\u5c64\u5316\u3002\u9ad8\u901f\u5316\u7b49\u3005\u3002<\/p>\n<pre class=\"lang:vb decode:true \">Dim caption As String\r\n\r\nSub auto_open()\r\n\r\nOn Error Resume Next\r\n\r\ncaption = \"\u4f1a\u54e1\u691c\u7d22\u30d5\u30a9\u30fc\u30e0\"\r\n\r\nFor i = 1 To 3\r\n  Application.CommandBars(\"cell\").Controls(caption).Delete\r\nNext\r\n\r\nWith Application.CommandBars(\"cell\").Controls.Add\r\n  .OnAction = \"show_form\"\r\n  .caption = caption\r\nEnd With\r\n\r\nCall show_form\r\n\r\n'With Application.CommandBars(\"cell\").Controls.Add(Type:=msoControlPopup)\r\n'  .caption = \"\u30e1\u30cb\u30e5\u30fc\"\r\n'  With .Controls.Add(Type:=msoControlButton)\r\n'  .caption = \"\u30a2\u30a4\u30c6\u30e0\"\r\n'  .OnAction = \"show_form\"\r\n'  End With\r\n'End With\r\n\r\nEnd Sub\r\n\r\nSub auto_close()\r\n\r\nOn Error Resume Next\r\n\r\nFor i = 1 To 3\r\n  Application.CommandBars(\"cell\").Controls(caption).Delete\r\nNext\r\n\r\n' Application.CommandBars(\"cell\").Controls(\"\u30e1\u30cb\u30e5\u30fc\").Delete\r\n\r\nEnd Sub\r\n\r\nSub Initialize()\r\n\r\nApplication.ScreenUpdating = False\r\nApplication.EnableEvents = False\r\nApplication.DisplayAlerts = False\r\nApplication.Calculation = xlCalculationManual ' \u95a2\u6570\u5229\u7528\u6ce8\u610f\r\n    \r\nEnd Sub\r\n\r\nSub Finalize()\r\n\r\nApplication.Calculation = xlCalculationAutomatic\r\nApplication.DisplayAlerts = True\r\nApplication.EnableEvents = True\r\nApplication.ScreenUpdating = True\r\n    \r\nEnd Sub\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3044\u3064\u3082\u5fd8\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u30e1\u30e2\u3002 \u53f3\u30af\u30ea\u30c3\u30af\u30e1\u30cb\u30e5\u30fc\u306e\u968e\u5c64\u5316\u3002\u9ad8\u901f\u5316\u7b49\u3005\u3002 Dim caption As String Sub auto_open() On Error Resume Next caption = &#8220;\u4f1a\u54e1\u691c\u7d22 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/appbay.org\/?p=3824\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;VBA \u8d77\u52d5\u90e8\u5206\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5],"class_list":["post-3824","post","type-post","status-publish","format-standard","hentry","category-1","tag-vba"],"_links":{"self":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3824"}],"version-history":[{"count":4,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3824\/revisions"}],"predecessor-version":[{"id":4417,"href":"https:\/\/appbay.org\/index.php?rest_route=\/wp\/v2\/posts\/3824\/revisions\/4417"}],"wp:attachment":[{"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/appbay.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}