计算床单数量直到具体

发布于 2025-01-26 01:12:18 字数 88 浏览 5 评论 0原文

VBA内有没有办法计算工作簿中存在的工作表数量,直到达到某个工作表名称为止。例如,我试图停止的工作表称为“摘要”。我想知道在那张床单之前有多少张纸,包括“摘要”。

Is there a way within vba to count the number of worksheets present in a workbook until a certain worksheet name is reached. For example, the worksheet that I am trying to stop at is called "Summary". I want to know how many sheets are present before that sheet including the "Summary" one.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

永言不败 2025-02-02 01:12:18

我是堆栈溢出/编码的新手,直到我完成过度复杂版本的方式之前,我才看到底层的响应。

sub countingsheets()

test1 = Sheets.Count
Count = 0
For I = 1 To test1
    If Sheets(I).Name <> Sheets("Summary").Name Then
        Count = Count + 1
    Else
        Exit Sub
    End If
Next

end sub

I am new to stack overflow/coding and did not see the undercomplicated response until I finished my way over-complicated version.

Sub CountingSheets()

test1 = Sheets.Count
Count = 0
For I = 1 To test1
    If Sheets(I).Name <> Sheets("Summary").Name Then
        Count = Count + 1
    Else
        Exit Sub
    End If
Next

End Sub

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文