{"id":90,"date":"2024-11-26T07:03:40","date_gmt":"2024-11-25T23:03:40","guid":{"rendered":"https:\/\/lilia-study.com\/lang\/eng\/?p=90"},"modified":"2024-11-26T07:03:48","modified_gmt":"2024-11-25T23:03:48","slug":"nextprevious","status":"publish","type":"post","link":"https:\/\/lilia-study.com\/lang\/chs\/excel\/excel-vba\/sheet\/nextprevious\/","title":{"rendered":"Excel VBA \u64cd\u4f5c\u4e0b\uff08\u53f3\uff09\u5de5\u4f5c\u8868\u3001\u4e0a\uff08\u5de6\uff09\u5de5\u4f5c\u8868"},"content":{"rendered":"<p><!-- wp:html --><\/p>\n<p><span class=\"icon_point color01\"><\/span>&nbsp;\u672c\u6587\u7531\u65e5\u6587\u8bd1\u6210\u4e2d\u6587\u3002<\/p>\n<p><!-- \/wp:html --><\/p>\n\n\n\n\n<p>\u672c\u8282\u8bb0\u5f55\u4e86\u5982\u4f55\u5728 Excel VBA \u4e2d\u64cd\u4f5c\u4e0b\u4e00\u5f20\uff08\u53f3\u4fa7\uff09\u548c\u4e0a\u4e00\u5f20\uff08\u5de6\u4fa7\uff09\u5de5\u4f5c\u8868\u3002<\/p>\n\n\n\n<p>\u4e0b\u4e00\u5f20\u5de5\u4f5c\u8868\u4f7f\u7528 \u201c\u4e0b\u4e00\u9875 \u201d\u5c5e\u6027\uff0c\u4e0a\u4e00\u5f20\u5de5\u4f5c\u8868\u4f7f\u7528 \u201c\u4e0a\u4e00\u9875 \u201d\u5c5e\u6027\u3002<\/p>\n\n\n<p><!-- wp:html --><\/p>\n<p style=\"margin-bottom:0;padding-bottom:0;\">&lt;&nbsp;Sponsored Links&nbsp;&gt;<\/p>\n<p><script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br \/>\n<!-- lilia top --><br \/>\n<ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-4504956686889525\" data-ad-slot=\"2727563599\" data-ad-format=\"auto\" data-full-width-responsive=\"true\"><\/ins><br \/>\n<script>\n(adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\n<!-- \/wp:html --><\/p>\n\n\n\n\n<h2 class=\"wp-block-heading\">\u53e5\u6cd5 &#8220;Next&#8221; &#8220;Previous&#8221;<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Next<\/h3>\n\n\n\n<div class=\"box_style box_style_orange\">\n<div class=\"box_inner\">\n<p class=\"b big\">WorksheetObject.Next<\/p>\n<\/div>\n<\/div>\n\n\n\n<div style=\"height:40px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Previous<\/h3>\n\n\n\n<div class=\"box_style box_style_orange\">\n<div class=\"box_inner\">\n<p class=\"b big\">WorksheetObject.Previous<\/p>\n<\/div>\n<\/div>\n\n\n\n<p>\u3000<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u64cd\u4f5c\u4e0b\u4e00\u5f20\u6216\u4e0a\u4e00\u5f20\u7684\u793a\u4f8b<\/h2>\n\n\n\n<p>\u9009\u62e9\u6d3b\u52a8\u9875\u9762\u540e\u7684\u4e0b\u4e00\u4e2a\u9875\u9762\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro m30-b\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.125rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n  ActiveSheet.Next.Select\nEnd Sub\" style=\"color:#d8dee9ff;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">Sub<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">test<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  ActiveSheet.<\/span><span style=\"color: #81A1C1\">Next<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #81A1C1\">Select<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">End Sub<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious01.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-944\"\/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious02.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-945\"\/><\/figure>\n<\/div>\n\n\n<p class=\"al-c\">\u2193<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious03.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-946\"\/><\/figure>\n<\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u9009\u62e9\u6d3b\u52a8\u5de5\u4f5c\u8868\u4e4b\u524d\u7684\u5de5\u4f5c\u8868\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro m30-b\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.125rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n  ActiveSheet.Previous.Select\nEnd Sub\" style=\"color:#d8dee9ff;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">Sub<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">test<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  ActiveSheet.Previous.<\/span><span style=\"color: #81A1C1\">Select<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">End Sub<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious04.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-947\"\/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious03.png\" alt=\"\u30b7\u30fc\u30c8\" class=\"wp-image-946\"\/><\/figure>\n<\/div>\n\n\n<p class=\"al-c\">\u2193<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious02.png\" alt=\"\u30b7\u30fc\u30c8\" class=\"wp-image-945\"\/><\/figure>\n<\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u663e\u793a\u4e00\u6761\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u542b\u6d3b\u52a8\u5de5\u4f5c\u8868\u4e4b\u540e\u4e0b\u4e00\u5f20\u5de5\u4f5c\u8868\u7684\u540d\u79f0\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro m30-b\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.125rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.625rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n  With ActiveSheet\n    If .Next Is Nothing Then\n      MsgBox &quot;\u65e0\u5e8a\u5355&quot;\n    Else\n      MsgBox .Next.Name\n    End If\n  End With\nEnd Sub\" style=\"color:#d8dee9ff;display:none\" aria-label=\"\u590d\u5236\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">Sub<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">test<\/span><span style=\"color: #ECEFF4\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #81A1C1\">With<\/span><span style=\"color: #D8DEE9FF\"> ActiveSheet<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">If<\/span><span style=\"color: #D8DEE9FF\"> .<\/span><span style=\"color: #81A1C1\">Next<\/span><span style=\"color: #D8DEE9FF\"> Is<\/span><span style=\"color: #81A1C1\"> Nothing<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">Then<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #88C0D0\">MsgBox<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">\u65e0\u5e8a\u5355<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">Else<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">      <\/span><span style=\"color: #88C0D0\">MsgBox<\/span><span style=\"color: #D8DEE9FF\"> .<\/span><span style=\"color: #81A1C1\">Next<\/span><span style=\"color: #D8DEE9FF\">.Name<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">End If<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #88C0D0\">End<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">With<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">End Sub<\/span><\/span><\/code><\/pre><\/div>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious05.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-948\"\/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious06.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-949\"\/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious07.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-950\"\/><\/figure>\n<\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u5982\u679c\u53c2\u8003\u7eb8\u5f20\u4f4d\u4e8e\u8fb9\u7f18\u4e0a\uff0c\u5219\u4f1a\u51fa\u73b0\u9519\u8bef\uff0c\u7531 \u201cIs Nothng \u201d\u51b3\u5b9a\u3002<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" src=\"https:\/\/lilia-study.com\/wp-content\/uploads\/2020\/09\/NextPrevious08.png\" alt=\"\u30b7\u30fc\u30c8\u524d\u5f8c\" class=\"wp-image-951\"\/><\/figure>\n<\/div>\n\n<p><!-- wp:html --><\/p>\n<p style=\"margin-bottom:0;padding-bottom:0;\">&lt;&nbsp;Sponsored Links&nbsp;&gt;<\/p>\n<p><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js?client=ca-pub-4504956686889525\"\n     crossorigin=\"anonymous\"><\/script><br \/>\n<!-- lilia bottom --><br \/>\n<ins class=\"adsbygoogle\"\n     style=\"display:inline-block;width:336px;height:280px\"\n     data-ad-client=\"ca-pub-4504956686889525\"\n     data-ad-slot=\"7848928897\"><\/ins><br \/>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script><br \/>\n<!-- \/wp:html --><\/p>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u8282\u8bb0\u5f55\u4e86\u5982\u4f55\u5728 Excel VBA \u4e2d\u64cd\u4f5c\u4e0b\u4e00\u5f20\uff08\u53f3\u4fa7\uff09\u548c\u4e0a\u4e00\u5f20\uff08\u5de6\u4fa7\uff09\u5de5\u4f5c\u8868\u3002 \u4e0b\u4e00\u5f20\u5de5\u4f5c\u8868\u4f7f\u7528 \u201c\u4e0b\u4e00\u9875 \u201d\u5c5e\u6027\uff0c\u4e0a\u4e00\u5f20\u5de5\u4f5c\u8868\u4f7f\u7528 \u201c\u4e0a\u4e00\u9875 \u201d\u5c5e\u6027\u3002 \u53e5\u6cd5 &#8220;Next&#8221; &#8220;Pr [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,2,18],"tags":[],"class_list":{"0":"post-90","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-excel","7":"category-excel-vba","8":"category-sheet"},"_links":{"self":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":0,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"wp:attachment":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}