{"id":56,"date":"2024-10-07T06:53:09","date_gmt":"2024-10-06T22:53:09","guid":{"rendered":"https:\/\/lilia-study.com\/lang\/eng\/?p=56"},"modified":"2024-10-07T06:53:26","modified_gmt":"2024-10-06T22:53:26","slug":"shp-rotation","status":"publish","type":"post","link":"https:\/\/lilia-study.com\/lang\/chs\/excel\/excel-vba\/shape\/shp-rotation\/","title":{"rendered":"Excel VBA \u5728\u5de5\u4f5c\u8868\u4e0a\u65cb\u8f6c\u56fe\u50cf\uff08\u81ea\u52a8\u6210\u578b\uff09-Rotation"},"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>\u8fd9\u662f\u4f7f\u7528 Excel VBA \u5c06\u5de5\u4f5c\u8868\u4e0a\u7684\u56fe\u50cf\uff08\u81ea\u52a8\u6210\u578b\uff09\u5411\u53f3\u6216\u5411\u5de6\u65cb\u8f6c\u7684\u8bb0\u5f55\u3002<\/p>\n\n\n\n<p>\u8981\u65cb\u8f6c\u56fe\u50cf\uff0c\u8bf7\u4f7f\u7528 \u201cRotation\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\">\u65cb\u8f6c\u56fe\u50cf\uff08\u81ea\u52a8\u5851\u5f62\uff09\u793a\u4f8b<\/h2>\n\n\n\n<p>\u8bbe\u7f6e\u4e00\u4e2a\u6b63\u6570\u5411\u53f3\u65cb\u8f6c\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u8d1f\u6570\u5411\u5de6\u65cb\u8f6c\u3002<\/p>\n\n\n\n<p>\u5c06\u56fe\u50cf\u5411\u53f3\u65cb\u8f6c 45 \u5ea6\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-highlight-hover\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#657B83;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);--cbp-line-highlight-color:rgba(43, 150, 189, 0.2);line-height:1.8rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n    Dim shp As Shape\n    Set shp = ActiveSheet.Shapes(1)\n\n    With shp\n        .Rotation = 45\n    End With\nEnd Sub\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" 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=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">Sub<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #268BD2\">test<\/span><span style=\"color: #657B83\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #586E75; font-weight: bold\">Dim<\/span><span style=\"color: #268BD2\"> shp <\/span><span style=\"color: #859900\">As<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">Shape<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #586E75; font-weight: bold\">Set <\/span><span style=\"color: #268BD2\">shp<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> ActiveSheet.<\/span><span style=\"color: #268BD2\">Shapes<\/span><span style=\"color: #657B83\">(<\/span><span style=\"color: #D33682\">1<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #859900\">With<\/span><span style=\"color: #657B83\"> shp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">        .<\/span><span style=\"color: #268BD2\">Rotation<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #D33682\">45<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #268BD2\">End<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">With<\/span><\/span>\n<span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">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\/08\/shaperatation01.png\" alt=\"rotation\" class=\"wp-image-485\"\/><\/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\/08\/shaperatation02.png\" alt=\"rotation\" class=\"wp-image-486\"\/><\/figure>\n<\/div>\n\n\n<p>\u3000<\/p>\n\n\n\n<p>\u5c06\u56fe\u50cf\u5411\u5de6\u65cb\u8f6c 45 \u5ea6\u3002<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers cbp-highlight-hover\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:1.5rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#657B83;--cbp-line-number-width:calc(1 * 0.6 * 1.5rem);--cbp-line-highlight-color:rgba(43, 150, 189, 0.2);line-height:1.8rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" data-code=\"Sub test()\n    Dim shp As Shape\n    Set shp = ActiveSheet.Shapes(1)\n\n    With shp\n        .Rotation = -45\n    End With\nEnd Sub\" style=\"color:#657B83;display:none\" aria-label=\"Copy\" 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=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki solarized-light\" style=\"background-color: #FDF6E3\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">Sub<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #268BD2\">test<\/span><span style=\"color: #657B83\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #586E75; font-weight: bold\">Dim<\/span><span style=\"color: #268BD2\"> shp <\/span><span style=\"color: #859900\">As<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">Shape<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #586E75; font-weight: bold\">Set <\/span><span style=\"color: #268BD2\">shp<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> ActiveSheet.<\/span><span style=\"color: #268BD2\">Shapes<\/span><span style=\"color: #657B83\">(<\/span><span style=\"color: #D33682\">1<\/span><span style=\"color: #657B83\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #859900\">With<\/span><span style=\"color: #657B83\"> shp<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">        .<\/span><span style=\"color: #268BD2\">Rotation<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">=<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #D33682\">-45<\/span><\/span>\n<span class=\"line\"><span style=\"color: #657B83\">    <\/span><span style=\"color: #268BD2\">End<\/span><span style=\"color: #657B83\"> <\/span><span style=\"color: #859900\">With<\/span><\/span>\n<span class=\"line\"><span style=\"color: #586E75; font-weight: bold\">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\/08\/shaperatation03.png\" alt=\"rotation\" class=\"wp-image-487\"\/><\/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\/08\/shaperatation04.png\" alt=\"rotation\" class=\"wp-image-488\"\/><\/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","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4f7f\u7528 Excel VBA \u5c06\u5de5\u4f5c\u8868\u4e0a\u7684\u56fe\u50cf\uff08\u81ea\u52a8\u6210\u578b\uff09\u5411\u53f3\u6216\u5411\u5de6\u65cb\u8f6c\u7684\u8bb0\u5f55\u3002 \u8981\u65cb\u8f6c\u56fe\u50cf\uff0c\u8bf7\u4f7f\u7528 \u201cRotation\u201d \u5c5e\u6027\u3002 \u65cb\u8f6c\u56fe\u50cf\uff08\u81ea\u52a8\u5851\u5f62\uff09\u793a\u4f8b \u8bbe\u7f6e\u4e00\u4e2a\u6b63\u6570\u5411\u53f3\u65cb\u8f6c\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u8d1f\u6570\u5411\u5de6\u65cb\u8f6c\u3002 \u5c06\u56fe\u50cf\u5411\u53f3\u65cb\u8f6c  [&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,9],"tags":[],"class_list":{"0":"post-56","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-excel","7":"category-excel-vba","8":"category-shape"},"_links":{"self":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/56","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=56"}],"version-history":[{"count":0,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"wp:attachment":[{"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lilia-study.com\/lang\/chs\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}