{"id":481,"date":"2024-10-31T18:32:07","date_gmt":"2024-10-31T10:32:07","guid":{"rendered":"https:\/\/5133333.xyz\/?p=481"},"modified":"2024-10-31T18:36:14","modified_gmt":"2024-10-31T10:36:14","slug":"vba-%e7%bb%99youtube%e9%93%be%e6%8e%a5%e8%87%aa%e5%8a%a8%e5%8a%a0%e4%b8%8a-videos","status":"publish","type":"post","link":"https:\/\/5133333.xyz\/?p=481","title":{"rendered":"VBA-\u7ed9Youtube\u94fe\u63a5\u81ea\u52a8\u52a0\u4e0a\/videos"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li>\u786e\u4fdd\u5de5\u4f5c\u8868\u540d\u79f0\u5728\u4ee3\u7801\u4e2d\u6b63\u786e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u5de5\u4f5c\u8868\u540d\u4e3a\u201cSheet1\u201d\uff0c\u4ee3\u7801\u9700\u8981\u5339\u914d\u3002\u5982\u679c\u4f60\u7684\u5de5\u4f5c\u8868\u540d\u79f0\u4e0d\u540c\uff0c\u8bf7\u66ff\u6362 <code>Set ws = ThisWorkbook.Sheets(\"<strong>Sheet1<\/strong>\")<\/code> \u4e2d\u7684<strong>\u201cSheet1\u201d<\/strong>\u3002<\/li>\n\n\n\n<li>\u786e\u4fdd\u5de5\u4f5c\u7c3f\u4e2d\u786e\u5b9e\u5b58\u5728\u8be5\u5de5\u4f5c\u8868\u3002<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sub AddVideosToColumnH()\n    Dim ws As Worksheet\n    Dim lastRow As Long\n    Dim i As Long\n    \n    Set ws = ThisWorkbook.Sheets(\"Sheet1\") ' <strong>\u8bf7\u6839\u636e\u5b9e\u9645\u5de5\u4f5c\u8868\u540d\u79f0\u4fee\u6539<\/strong>\n    \n    ' \u627e\u5230H\u5217\u7684\u6700\u540e\u4e00\u884c\n    lastRow = ws.Cells(ws.Rows.Count, \"H\").End(xlUp).Row\n    \n    ' \u4eceH2\u5f00\u59cb\u904d\u5386\n    For i = 2 To lastRow\n        If ws.Cells(i, \"H\").Value &lt;> \"\" Then ' \u68c0\u67e5H\u5217\u662f\u5426\u6709\u503c\n            ws.Cells(i, \"H\").Value = ws.Cells(i, \"H\").Value &amp; \"\/videos\"\n        End If\n    Next i\nEnd Sub\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,11],"tags":[102,100,40,101],"class_list":["post-481","post","type-post","status-publish","format-standard","hentry","category-excel","category-office","tag-videos","tag-vba","tag-youtube","tag-yt"],"_links":{"self":[{"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/5133333.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=481"}],"version-history":[{"count":5,"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/5133333.xyz\/index.php?rest_route=\/wp\/v2\/posts\/481\/revisions\/490"}],"wp:attachment":[{"href":"https:\/\/5133333.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/5133333.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/5133333.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}