{"id":686,"date":"2023-09-27T15:58:58","date_gmt":"2023-09-27T15:58:58","guid":{"rendered":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/"},"modified":"2023-12-10T11:46:45","modified_gmt":"2023-12-10T11:46:45","slug":"%e6%bf%80%e6%b4%bb%e8%a1%a8","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528vba\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f"},"content":{"rendered":"<div class=\"excel-\" id=\"excel-1483254929\"><script type=\"text\/javascript\">\r\n\tatOptions = {\r\n\t\t'key' : 'c1158f160081d6540a8409e6925dab94',\r\n\t\t'format' : 'iframe',\r\n\t\t'height' : 250,\r\n\t\t'width' : 300,\r\n\t\t'params' : {}\r\n\t};\r\n<\/script>\r\n<script type=\"text\/javascript\" src=\"\/\/www.highperformanceformat.com\/c1158f160081d6540a8409e6925dab94\/invoke.js\"><\/script><\/div> <p>\u5047\u8bbe\u60a8\u6b63\u5728\u4f7f\u7528\u591a\u4e2a\u5de5\u4f5c\u8868\uff0c\u5e76\u4e14\u5f88\u96be\u4f7f\u7528\u9009\u9879\u5361\u5bfc\u822a\u5230\u5de5\u4f5c\u8868\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002<\/p><p>\u5e76\u4e14\uff0c\u8981\u4e3a\u6b64\u7f16\u5199 VBA \u4ee3\u7801\uff0c\u60a8\u9700\u8981\u4f7f\u7528 Worksheet.Activate \u65b9\u6cd5\u3002\u5728\u672c\u6587\u4e2d\uff0c\u6211\u60f3\u4e0e\u60a8\u5206\u4eab\u4e00\u79cd\u7f16\u5199\u6b64\u4ee3\u7801\u6765\u6fc0\u6d3b\u6216\u9009\u62e9\u5de5\u4f5c\u8868\u7684\u7b80\u5355\u65b9\u6cd5\u3002\u5728\u7f16\u5199\u8fd9\u6bb5\u4ee3\u7801\u4e4b\u524d\uff0c\u4f60\u5fc5\u987b\u4e86\u89e3\u8fd9\u4e2a\u65b9\u6cd5\u3002<\/p><h2 class=\"wp-block-heading\">\u5de5\u4f5c\u8868.\u6fc0\u6d3b\u65b9\u6cd5<\/h2><p>\u5728\u6b64\u65b9\u6cd5\u4e2d\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u8981\u6fc0\u6d3b\u7684\u5de5\u4f5c\u8868\u7684\u540d\u79f0\u6216\u7f16\u53f7\u3002\u5047\u8bbe\u60a8\u9700\u8981\u6fc0\u6d3b\u5de5\u4f5c\u8868 1\uff0c\u5219\u4ee3\u7801\u4e3a\uff1a<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Worksheets(\"Sheet1\").Activate<\/code><\/pre><p>\u6216\u8005\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u56fe\u7eb8\u7f16\u53f7\u3002<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Worksheets(\"1\").Activate<\/code><\/pre><p>\u6240\u4ee5\u6700\u7ec8\u7684\u4ee3\u7801\u5c06\u662f\uff1a<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub ActivateSheet1() Worksheets(\"Sheet1\").Activate End Sub<\/code><\/pre><h2 class=\"wp-block-heading\">\u793a\u4f8b\uff1a\u4f7f\u7528 VBA \u6fc0\u6d3b\u7535\u5b50\u8868\u683c<\/h2><p>\u5728\u73b0\u5b9e\u751f\u6d3b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e0d\u540c\u7684\u65b9\u5f0f\u4f7f\u7528\u6b64\u65b9\u6cd5\u3002\u8fd9\u91cc\u6709\u4e00\u4e9b\u3002<\/p><h3 class=\"wp-block-heading\"> 1.\u6253\u5f00\u7535\u5b50\u8868\u683c\u540e\u6fc0\u6d3b<\/h3><p>\u5982\u679c\u8981\u5728\u6bcf\u6b21\u6253\u5f00\u5de5\u4f5c\u7c3f\u65f6\u6fc0\u6d3b\u7279\u5b9a\u5de5\u4f5c\u8868\uff0c\u8bf7\u5c06\u6b64 VBA \u4ee3\u7801\u547d\u540d\u4e3a auto_open\u3002<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub auto_open() Worksheets(\"Sheet1\").Activate End Su<\/code><\/pre><h3 class=\"wp-block-heading\"> 2. \u542f\u7528\u4e00\u4e2a\u5de5\u4f5c\u8868\u5e76\u9690\u85cf\u6240\u6709\u5176\u4ed6\u5de5\u4f5c\u8868<\/h3><p>\u4e5f\u8bb8\u60a8\u60f3\u8981\u8f6c\u5230\u4e00\u4e2a\u5de5\u4f5c\u8868\u5e76\u9690\u85cf\u5de5\u4f5c\u7c3f\u4e2d\u7684\u6240\u6709\u5176\u4ed6\u5de5\u4f5c\u8868\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u4ee3\u7801\u6765\u5b8c\u6210\u6b64\u64cd\u4f5c\u3002<\/p><pre class=\"wp-block-code\" title=\"Coded\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub HideWorksheet() Dim ws As Worksheet For Each ws In ThisWorkbook.Worksheets If ws.Name &lt;&gt; \"Sheet1\" Then ws.Visible = xlSheetHidden End If Next ws End Sub<\/code><\/pre><p>\u66f4\u6539\u4e0a\u9762\u4ee3\u7801\u4e2d\u7684\u5de5\u4f5c\u8868\u540d\u79f0\u4ee5\u4f7f\u5176\u66f4\u6709\u7528\u3002<\/p><div class=\"gb-container gb-container-4db6181c gb-container-mt\"> <a class=\"gb-button gb-button-c5897111 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/cn\/\u7ef4\u5df4\/\">\u4ec0\u4e48\u662fVBA<\/a><h2 class=\"gb-headline gb-headline-665e5f6b gb-headline-text gb-headline-mt-heading\">\u76f8\u5173\u6559\u7a0b<\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-a20baf7c gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-65ddf67e\"><div class=\"gb-container gb-container-65ddf67e\"><ul><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u900f\u660e\u7eb8\/\">\u5728 Excel \u4e2d\u4f7f\u7528 VBA \u6e05\u9664\u6574\u4e2a\u5de5\u4f5c\u8868<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u590d\u5370\u8868\/\">\u4f7f\u7528 VBA \u5728 Excel \u4e2d\u590d\u5236\u548c\u79fb\u52a8\u5de5\u4f5c\u8868<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u6570\u53f6\u5b50\/\">\u5728 Excel \u4e2d\u4f7f\u7528 VBA \u8ba1\u7b97 COUNT \u4e2a\u5de5\u4f5c\u8868<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u5220\u9664\u5de5\u4f5c\u8868-1\/\">\u5728 Excel \u4e2d\u4f7f\u7528 VBA \u5220\u9664\u5de5\u4f5c\u8868<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u9690\u85cf\u8868\/\">\u5728 Excel \u4e2d\u4f7f\u7528 VBA \u9690\u85cf\u548c\u663e\u793a\u5de5\u4f5c\u8868<\/a><\/li><\/ul><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"ub_ctt_via":"","footnotes":""},"class_list":["post-686","page","type-page","status-publish","hentry"],"featured_image_src":null,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09<\/title>\n<meta name=\"description\" content=\"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/exceladvisor.org\/cn\/\u6fc0\u6d3b\u8868\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09\" \/>\n<meta property=\"og:description\" content=\"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/cn\/\u6fc0\u6d3b\u8868\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-10T11:46:45+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/\",\"url\":\"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/\",\"name\":\"\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/#website\"},\"datePublished\":\"2023-09-27T15:58:58+00:00\",\"dateModified\":\"2023-12-10T11:46:45+00:00\",\"description\":\"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/exceladvisor.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4f7f\u7528vba\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/#website\",\"url\":\"https:\/\/exceladvisor.org\/cn\/\",\"name\":\"Excel Advisor\",\"description\":\"\u60a8\u7684\u6570\u636e\u7edf\u6cbb\u7ec8\u6781\u6307\u5357\",\"publisher\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/exceladvisor.org\/cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/#organization\",\"name\":\"Excel Advisor\",\"url\":\"https:\/\/exceladvisor.org\/cn\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/exceladvisor.org\/cn\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/cn\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png\",\"width\":105,\"height\":36,\"caption\":\"Excel Advisor\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09","description":"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/exceladvisor.org\/cn\/\u6fc0\u6d3b\u8868\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09","og_description":"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801","og_url":"https:\/\/exceladvisor.org\/cn\/\u6fc0\u6d3b\u8868\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-10T11:46:45+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/","url":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/","name":"\u5982\u4f55\u4f7f\u7528VBA\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f \uff08\u65b9\u6cd52023\uff09","isPartOf":{"@id":"https:\/\/exceladvisor.org\/cn\/#website"},"datePublished":"2023-09-27T15:58:58+00:00","dateModified":"2023-12-10T11:46:45+00:00","description":"\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528 VBA \u4ee3\u7801\u6765\u6fc0\u6d3b\u4efb\u4f55\u5de5\u4f5c\u8868\u3002\u5e76\u4e14\uff0c\u7f16\u5199VBA\u4ee3\u7801","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/cn\/%e6%bf%80%e6%b4%bb%e8%a1%a8\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/exceladvisor.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4f7f\u7528vba\u6fc0\u6d3b\u5de5\u4f5c\u8868\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/exceladvisor.org\/cn\/#website","url":"https:\/\/exceladvisor.org\/cn\/","name":"Excel Advisor","description":"\u60a8\u7684\u6570\u636e\u7edf\u6cbb\u7ec8\u6781\u6307\u5357","publisher":{"@id":"https:\/\/exceladvisor.org\/cn\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/exceladvisor.org\/cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/exceladvisor.org\/cn\/#organization","name":"Excel Advisor","url":"https:\/\/exceladvisor.org\/cn\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/exceladvisor.org\/cn\/#\/schema\/logo\/image\/","url":"https:\/\/exceladvisor.org\/cn\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","contentUrl":"https:\/\/exceladvisor.org\/cn\/wp-content\/uploads\/2023\/12\/exceladvisor.org_.png","width":105,"height":36,"caption":"Excel Advisor"},"image":{"@id":"https:\/\/exceladvisor.org\/cn\/#\/schema\/logo\/image\/"}}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/comments?post=686"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/686\/revisions"}],"predecessor-version":[{"id":966,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/686\/revisions\/966"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/media?parent=686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}