{"id":487,"date":"2023-10-26T10:22:15","date_gmt":"2023-10-26T10:22:15","guid":{"rendered":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/"},"modified":"2023-12-10T11:46:46","modified_gmt":"2023-12-10T11:46:46","slug":"%e7%ad%9b%e9%80%89","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528vba\u7684filter\u529f\u80fd\uff1f"},"content":{"rendered":"<div class=\"excel-\" id=\"excel-4167574123\"><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>VBA FILTER \u51fd\u6570\u5217\u5728 VBA \u51fd\u6570\u8868\u7c7b\u522b\u4e2d\u3002\u5f53\u60a8\u5728 VBA \u4ee3\u7801\u4e2d\u4f7f\u7528\u5b83\u65f6\uff0c<strong>\u5b83\u53ef\u4ee5\u6839\u636e\u60a8\u6307\u5b9a\u4e3a\u5b50\u96c6\u7684\u5b57\u7b26\u4e32\u4ece\u5b57\u7b26\u4e32\u6570\u7ec4\u4e2d\u8fd4\u56de\u5b57\u7b26\u4e32<\/strong>\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u5b83\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u7136\u540e\u5b83\u5c06\u641c\u7d22\u8be5\u5b57\u7b26\u4e32\u5c5e\u4e8e\u4e3b\u5b57\u7b26\u4e32\u7684\u6240\u6709\u503c\u3002<\/p><h2 class=\"wp-block-heading\">\u53e5\u6cd5<\/h2><p><strong>\u8fc7\u6ee4\u5668\uff08ArraySource\uff0c\u5339\u914d\uff0c[\u5305\u542b]\uff0c[\u6bd4\u8f83]\uff09<\/strong><\/p><h2 class=\"wp-block-heading\">\u4e89\u8bba<\/h2><ul><li><strong>SourceArray<\/strong> \uff1a\u5305\u542b\u8981\u8fc7\u6ee4\u7684\u5b57\u7b26\u4e32\u7684\u6570\u7ec4\u3002<\/li><li> <strong>Match<\/strong> \uff1a\u60a8\u8981\u5728 SourceArray \u4e2d\u8fc7\u6ee4\u7684\u5b57\u7b26\u4e32\u3002<\/li><li> <strong>[Ininclude]<\/strong> \uff1a\u8fd9\u662f\u4e00\u4e2a\u5e03\u5c14\u503c\uff0c\u7528\u4e8e\u5b9a\u4e49\u8981\u8fc7\u6ee4\u7684\u5929\u6c14\u503c\u662f\u5426\u5305\u542b\u5339\u914d\u9879\uff0c\u6216\u8005\u4e0d\u5305\u542b[\u8fd9\u662f\u4e00\u4e2a\u53ef\u9009\u53c2\u6570\uff0c\u5982\u679c\u7701\u7565\uff0cVBA \u9ed8\u8ba4\u4e3a TRUE]\u3002<\/li><li> <strong>[Compare]<\/strong> \uff1a\u4e00\u4e2a\u5b57\u7b26\u4e32\u503c\uff0c\u7528\u4e8e\u5b9a\u4e49\u8fc7\u6ee4\u6570\u7ec4\u65f6\u8981\u6267\u884c\u7684\u6bd4\u8f83[\u8fd9\u662f\u4e00\u4e2a\u53ef\u9009\u53c2\u6570\uff0c\u5982\u679c\u7701\u7565\uff0cVBA \u9ed8\u8ba4\u91c7\u7528 vbBinaryCompare]\u3002<ul><li> vbBinaryCompare\uff1a\u7528\u4e8e\u4e8c\u8fdb\u5236\u6bd4\u8f83\u3002<\/li><li> vbTextCompare\uff1a\u7528\u4e8e\u6587\u672c\u6bd4\u8f83\u3002<\/li><li> vbDatabaseCompare\uff1a\u7528\u4e8e\u6570\u636e\u5e93\u6bd4\u8f83\u3002<\/li><\/ul><\/li><\/ul><h2 class=\"wp-block-heading\">\u4f8b\u5b50<\/h2><p>\u8981\u5b9e\u9645\u4e86\u89e3\u5982\u4f55\u4f7f\u7528 VBA FILTER \u51fd\u6570\uff0c\u60a8\u9700\u8981\u67e5\u770b\u4e0b\u9762\u7684\u793a\u4f8b\uff0c\u6211\u4eec\u5728\u5176\u4e2d\u7f16\u5199\u4e86\u4f7f\u7528\u8be5\u51fd\u6570\u7684 vba \u4ee3\u7801\uff1a <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" title=\"\u793a\u4f8b\u8fc7\u6ee4\u5668\u51fd\u6570-vba\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\" sizes=\"auto, \" srcset=\"\" alt=\"example-vba-filter-function\" width=\"849\" height=\"588\"><\/figure><\/div><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub example_FILTER() Dim nameAry As Variant Dim myAry(0 To 4) As String myAry(0) = Range(\"A1\").Value myAry(1) = Range(\"A2\").Value myAry(2) = Range(\"A3\").Value myAry(3) = Range(\"A4\").Value myAry(4) = Range(\"A5\").Value nameAry = Filter(myAry, \"Sh\") End Sub<\/code><\/pre><p>\u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u4f7f\u7528 FILTER \u4ece\u6570\u7ec4\u4e2d\u83b7\u53d6\u503c\uff08myAry \u5177\u6709\u6765\u81ea\u6211\u4eec\u5b9a\u4e49\u7684\u5355\u5143\u683c\u7684\u503c\uff09\uff0c\u5176\u4e2d\u5305\u542b\u201cSh\u201d\uff0c\u73b0\u5728\u201cnameAry\u201d\u5305\u542b\u201cJay Sh\u201d\u548c\u201cPeter\u201d Sh&#8217; \u56e0\u4e3a\u4e24\u8005\u90fd\u5305\u542b\u201cSh\u201d\u3002<\/p><h2 class=\"wp-block-heading\">\u8bc4\u8bba<\/h2><ul><li>\u5982\u679c\u60a8\u63d0\u4f9b\u7684\u6e90\u6570\u7ec4\u4e3a NULL\uff0cVBA \u5c06\u8fd4\u56de\u9519\u8bef\u3002<\/li><li>\u8fc7\u6ee4\u5668\u8fd4\u56de\u7684\u6570\u7ec4\u59cb\u7ec8\u662f\u4e00\u7ef4\u3001\u4ece\u96f6\u5f00\u59cb\u7684\u6570\u7ec4\u3002<\/li><\/ul><div class=\"gb-container gb-container-078e99df gb-container-mt\"> <a class=\"gb-button gb-button-b61bc159 gb-button-text gb-button-mt-button\" href=\"https:\/\/exceladvisor.org\/cn\/\u7ef4\u5df4\/\">\u4ec0\u4e48\u662fVBA<\/a><h2 class=\"gb-headline gb-headline-eb94b2aa gb-headline-text gb-headline-mt-heading\">\u76f8\u5173<a href=\"https:\/\/exceladvisor.org\/cn\/\u529f\u80fd\/\">VBA \u51fd\u6570<\/a><\/h2><div class=\"gb-grid-wrapper gb-grid-wrapper-bea82d60 gb-grid-wrapper-mt-grid\"><div class=\"gb-grid-column gb-grid-column-98a91fbb\"><div class=\"gb-container gb-container-98a91fbb\"><ul><li> <a href=\"https:\/\/exceladvisor.org\/cn\/\u90e8\u7f72\/\">VBA\u8868<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u52a0\u5165\/\">\u52a0\u5165VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/cn\/\u7ed1\u5b9a\/\">VBA \u7ed1\u5b9a<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u5206\u88c2\/\">\u5206\u5272VBA<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/cn\/\u8d85\u7ed1\u5b9a\/\">VBA \u8d85\u9650<\/a><\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-3151f7cb\"><div class=\"gb-container gb-container-3151f7cb\"><\/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-487","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\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09<\/title>\n<meta name=\"description\" content=\"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002\" \/>\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\/\u7b5b\u9009\/\" \/>\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\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09\" \/>\n<meta property=\"og:description\" content=\"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/cn\/\u7b5b\u9009\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-10T11:46:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\" \/>\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\/%e7%ad%9b%e9%80%89\/\",\"url\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/\",\"name\":\"\u5982\u4f55\u4f7f\u7528VBA\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\",\"datePublished\":\"2023-10-26T10:22:15+00:00\",\"dateModified\":\"2023-12-10T11:46:46+00:00\",\"description\":\"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/exceladvisor.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u4f7f\u7528vba\u7684filter\u529f\u80fd\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\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09","description":"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002","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\/\u7b5b\u9009\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u4f7f\u7528VBA\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09","og_description":"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002","og_url":"https:\/\/exceladvisor.org\/cn\/\u7b5b\u9009\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-10T11:46:46+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/","url":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/","name":"\u5982\u4f55\u4f7f\u7528VBA\u7684FILTER\u529f\u80fd\uff1f \uff08\u8bed\u6cd5+\u793a\u4f8b\uff09","isPartOf":{"@id":"https:\/\/exceladvisor.org\/cn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","datePublished":"2023-10-26T10:22:15+00:00","dateModified":"2023-12-10T11:46:46+00:00","description":"\u4e86\u89e3\u5982\u4f55\u901a\u8fc7\u8bed\u6cd5\u3001\u53c2\u6570\u548c\u793a\u4f8b\u4ee3\u7801\u4f7f\u7528 VBA FILTER \u51fd\u6570\u3002","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/exemple-de-fonction-de-filtre-vba.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/cn\/%e7%ad%9b%e9%80%89\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/exceladvisor.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u4f7f\u7528vba\u7684filter\u529f\u80fd\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\/487","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=487"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/487\/revisions"}],"predecessor-version":[{"id":971,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/487\/revisions\/971"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/media?parent=487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}