<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://qingliezhiquan.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=%E5%AE%8F%E8%AE%A1%E7%AE%97%E5%B7%A5%E4%BD%9C%E8%96%84%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E6%95%B0%E9%87%8F</id>
	<title>宏计算工作薄中的注释数量 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://qingliezhiquan.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=%E5%AE%8F%E8%AE%A1%E7%AE%97%E5%B7%A5%E4%BD%9C%E8%96%84%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E6%95%B0%E9%87%8F"/>
	<link rel="alternate" type="text/html" href="https://qingliezhiquan.com/mediawiki/index.php?title=%E5%AE%8F%E8%AE%A1%E7%AE%97%E5%B7%A5%E4%BD%9C%E8%96%84%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E6%95%B0%E9%87%8F&amp;action=history"/>
	<updated>2026-08-07T11:22:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://qingliezhiquan.com/mediawiki/index.php?title=%E5%AE%8F%E8%AE%A1%E7%AE%97%E5%B7%A5%E4%BD%9C%E8%96%84%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E6%95%B0%E9%87%8F&amp;diff=7862&amp;oldid=prev</id>
		<title>Mwroot: Created page with &quot;无权要求其改变工作习惯的同事，喜欢在单元格上用注释，要计算他搞了多少条注释，手动数是不切实际的，Kimi.ai 写一段宏解决了此问题。  &lt;syntaxhighlight lang=&quot;VBScript&quot; line&gt; Sub CountCommentsInAllSheets()     Dim wb As Workbook     Dim ws As Worksheet     Dim count As Integer     Dim totalComments As Integer          Set wb = ThisWorkbook     count = 0     totalComments = 0          &#039; 遍历工作簿中的所有工作...&quot;</title>
		<link rel="alternate" type="text/html" href="https://qingliezhiquan.com/mediawiki/index.php?title=%E5%AE%8F%E8%AE%A1%E7%AE%97%E5%B7%A5%E4%BD%9C%E8%96%84%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%E6%95%B0%E9%87%8F&amp;diff=7862&amp;oldid=prev"/>
		<updated>2025-09-29T01:50:26Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;无权要求其改变工作习惯的同事，喜欢在单元格上用注释，要计算他搞了多少条注释，手动数是不切实际的，Kimi.ai 写一段宏解决了此问题。  &amp;lt;syntaxhighlight lang=&amp;quot;VBScript&amp;quot; line&amp;gt; Sub CountCommentsInAllSheets()     Dim wb As Workbook     Dim ws As Worksheet     Dim count As Integer     Dim totalComments As Integer          Set wb = ThisWorkbook     count = 0     totalComments = 0          &amp;#039; 遍历工作簿中的所有工作...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;无权要求其改变工作习惯的同事，喜欢在单元格上用注释，要计算他搞了多少条注释，手动数是不切实际的，Kimi.ai 写一段宏解决了此问题。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;VBScript&amp;quot; line&amp;gt;&lt;br /&gt;
Sub CountCommentsInAllSheets()&lt;br /&gt;
    Dim wb As Workbook&lt;br /&gt;
    Dim ws As Worksheet&lt;br /&gt;
    Dim count As Integer&lt;br /&gt;
    Dim totalComments As Integer&lt;br /&gt;
    &lt;br /&gt;
    Set wb = ThisWorkbook&lt;br /&gt;
    count = 0&lt;br /&gt;
    totalComments = 0&lt;br /&gt;
    &lt;br /&gt;
    &amp;#039; 遍历工作簿中的所有工作表&lt;br /&gt;
    For Each ws In wb.Worksheets&lt;br /&gt;
        &amp;#039; 遍历当前工作表的每个单元格&lt;br /&gt;
        For Each cell In ws.UsedRange&lt;br /&gt;
            &amp;#039; 检查单元格是否有注释&lt;br /&gt;
            If Not cell.Comment Is Nothing Then&lt;br /&gt;
                count = count + 1&lt;br /&gt;
            End If&lt;br /&gt;
        Next cell&lt;br /&gt;
        &amp;#039; 将当前工作表的注释数加到总数&lt;br /&gt;
        totalComments = totalComments + count&lt;br /&gt;
        &amp;#039; 重置计数器以计算下一个工作表的注释数&lt;br /&gt;
        count = 0&lt;br /&gt;
    Next ws&lt;br /&gt;
    &lt;br /&gt;
    &amp;#039; 显示包含注释的单元格总数&lt;br /&gt;
    MsgBox &amp;quot;Total number of comments in the workbook: &amp;quot; &amp;amp; totalComments&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:MicroSoft Office]]&lt;/div&gt;</summary>
		<author><name>Mwroot</name></author>
	</entry>
</feed>