{"id":662,"date":"2023-09-29T01:41:24","date_gmt":"2023-09-29T01:41:24","guid":{"rendered":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/"},"modified":"2023-12-10T11:49:33","modified_gmt":"2023-12-10T11:49:33","slug":"%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c","status":"publish","type":"page","link":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/","title":{"rendered":"\u5982\u4f55\u5728vba\u4e2d\u4f7f\u7528if\u8bed\u53e5\uff1f"},"content":{"rendered":"<div class=\"excel-\" id=\"excel-3143785551\"><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>\u5728VBA\u4e2d\uff0c\u5f53\u4f7f\u7528<a href=\"https:\/\/exceladvisor.org\/cn\/\u5982\u679c-2\/\">IF\u8bed\u53e5<\/a>\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528GoTo\u8bed\u53e5\u9000\u51faIF\u3002\u8ba9\u6211\u5728\u8fd9\u91cc\u6f84\u6e05\u4e00\u4e0b\uff1b\u6ca1\u6709\u5355\u72ec\u7684\u9000\u51fa\u8bed\u53e5\u53ef\u4ee5\u4e0e IF \u4e00\u8d77\u4f7f\u7528\u6765\u9000\u51fa\u3002\u56e0\u6b64\uff0c\u5982\u679c\u5728\u7ed3\u675f\u8bed\u53e5\u884c\u547d\u4e2d\u4e4b\u524d\u4f7f\u7528 goto \u9000\u51fa IF \u4f1a\u66f4\u597d\u3002<\/p><p>\u8ba9\u6211\u4eec\u4e3e\u4e2a\u4f8b\u5b50\u6765\u7406\u89e3\u8fd9\u4e00\u70b9\u3002 <\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-57658\" src=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png\" sizes=\"auto, \" srcset=\"\" alt=\"vba-\u9000\u51fa-\u5982\u679c\" width=\"620\" height=\"512\"><\/figure><\/div><p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u5982\u60a8\u6240\u89c1\uff0c\u6211\u4eec\u4f7f\u7528 IF \u8bed\u53e5\u6765\u68c0\u67e5\u5355\u5143\u683c A1 \u4e2d\u662f\u5426\u6709\u503c\u3002\u5f53\u60a8<a href=\"https:\/\/exceladvisor.org\/cn\/\u6267\u884c\u5b8f2\/\">\u8fd0\u884c\u6b64\u4ee3\u7801<\/a>\u5e76\u4e14 A1 \u4e2d\u6ca1\u6709\u503c\u65f6\uff0cVBA \u5207\u6362\u5230\u201cLable1\u201d\u5e76\u6267\u884c\u4e0b\u9762\u7684\u4ee3\u7801\u3002\u56e0\u6b64\uff0c\u5b83\u5c06\u663e\u793a\u4e00\u4e2a\u8f93\u5165\u6846\uff0c\u7528\u4e8e\u5728\u5355\u5143\u683c A1 \u4e2d\u8f93\u5165\u503c\u3002<\/p><pre class=\"wp-block-code\"> <code class=\"language-visual-basic\" lang=\"visual-basic\">Sub myMacro() If Range(\"A1\") = \"\" Then GoTo Lable1 Else MsgBox \"there's a value in the cell.\" End If Lable1: Range(\"A1\").Value = _ InputBox(\"Enter Value\") End Sub<\/code><\/pre><p class=\"grey-note\">\u5728\u7f16\u5199 VBA \u4ee3\u7801\u65f6\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u9700\u8981\u9000\u51fa IF \u8bed\u53e5\u3002\u6b63\u5982\u60a8\u6240\u77e5\uff0c\u5728\u5355\u4e2a IF \u8bed\u53e5\u4e2d\u53ea\u80fd\u6709\u4e24\u4e2a\u6761\u4ef6\uff0c\u5982\u679c\u4e00\u4e2a\u6761\u4ef6\u4e3a\u771f\uff0cVBA \u5c06\u6267\u884c\u60a8\u63d0\u5230\u7684\u4ee3\u7801\uff0c\u7136\u540e\u81ea\u52a8\u9000\u51fa\u8be5\u8bed\u53e5\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\/\u5982\u679c-2\/\">VBA IF\uff08\u5982\u679c\u5219\u5426\u5219\uff09<\/a><\/li><li> <a href=\"https:\/\/exceladvisor.org\/cn\/\u5982\u679c\u548c\/\">VBA \u5982\u679c\u548c<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u5426\u5219\/\">VBA \u5982\u679c\u5426<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u5982\u679c\u6216\/\">VBA \u5982\u679c\u6216<\/a><\/li><li><a href=\"https:\/\/exceladvisor.org\/cn\/\u5d4c\u5957\u5982\u679c\/\">VBA \u5d4c\u5957 IF<\/a> <\/li><\/ul><\/div><\/div><div class=\"gb-grid-column gb-grid-column-50067b57\"><div class=\"gb-container gb-container-50067b57\"><\/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-662","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\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09<\/title>\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\/\u51fa\u53bb\u5982\u679c\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09\" \/>\n<meta property=\"og:url\" content=\"https:\/\/exceladvisor.org\/cn\/\u51fa\u53bb\u5982\u679c\/\" \/>\n<meta property=\"og:site_name\" content=\"Excel Advisor\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-10T11:49:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.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\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/\",\"url\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/\",\"name\":\"\u5982\u4f55\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09\",\"isPartOf\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png\",\"datePublished\":\"2023-09-29T01:41:24+00:00\",\"dateModified\":\"2023-12-10T11:49:33+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage\",\"url\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png\",\"contentUrl\":\"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u5bb6\",\"item\":\"https:\/\/exceladvisor.org\/cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5982\u4f55\u5728vba\u4e2d\u4f7f\u7528if\u8bed\u53e5\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\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09","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\/\u51fa\u53bb\u5982\u679c\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5982\u4f55\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09","og_url":"https:\/\/exceladvisor.org\/cn\/\u51fa\u53bb\u5982\u679c\/","og_site_name":"Excel Advisor","article_modified_time":"2023-12-10T11:49:33+00:00","og_image":[{"url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/","url":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/","name":"\u5982\u4f55\u5728VBA\u4e2d\u4f7f\u7528IF\u8bed\u53e5\uff1f \uff08\u6559\u7a0b 2023\uff09","isPartOf":{"@id":"https:\/\/exceladvisor.org\/cn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage"},"image":{"@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage"},"thumbnailUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png","datePublished":"2023-09-29T01:41:24+00:00","dateModified":"2023-12-10T11:49:33+00:00","breadcrumb":{"@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#primaryimage","url":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png","contentUrl":"https:\/\/exceladvisor.org\/wp-content\/uploads\/2023\/08\/1-sortie-vba-si.png"},{"@type":"BreadcrumbList","@id":"https:\/\/exceladvisor.org\/cn\/%e5%87%ba%e5%8e%bb%e5%a6%82%e6%9e%9c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u5bb6","item":"https:\/\/exceladvisor.org\/cn\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728vba\u4e2d\u4f7f\u7528if\u8bed\u53e5\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\/662","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=662"}],"version-history":[{"count":1,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/662\/revisions"}],"predecessor-version":[{"id":1240,"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/pages\/662\/revisions\/1240"}],"wp:attachment":[{"href":"https:\/\/exceladvisor.org\/cn\/wp-json\/wp\/v2\/media?parent=662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}