excel vba-循环时做 - 在单元格中约会

发布于 2025-01-23 08:42:11 字数 374 浏览 2 评论 0原文

我想增加定居日期(分配给单元N13),直到网络天数(分配给单元P11)达到3。

网络天数计数两个日期之间的工作日数量不包括假期。但是,我为此增加了一系列假期。

Sub Settlement_Date()

Do While Cells(16, 12) < 3
    
    Cells(14,11)
    
Loop

I want to increase the settlement date which is (assigned to cell N13) until the network days (assigned to cell P11) reaches 3.

Network days counts the number of weekdays between two dates excluding holidays. However, I added a range of holidays to it.

Sub Settlement_Date()

Do While Cells(16, 12) < 3
    
    Cells(14,11)
    
Loop

Excel sheet screenshot

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

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

发布评论

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

评论(2

謌踐踏愛綪 2025-01-30 08:42:11

要在循环中增加单元格(14,11),请将该行更改为

Cells(14,11) = Cells(14,11) + 1

to increase Cells(14,11) within the loop, change that line to

Cells(14,11) = Cells(14,11) + 1
有木有妳兜一样 2025-01-30 08:42:11

设法自己做,但是在我在这里找到的一些帖子中读了片段

Sub Settlement_Date()

Do While ActiveCell.Offset(0, 2).Value < 3 

    ActiveCell.Value = ActiveCell.Value + 1
    
Loop

End Sub

移动一个单元格
使用VBA 在单元格中添加一天

Managed to do it myself but got snippets in some of the post I found here

Sub Settlement_Date()

Do While ActiveCell.Offset(0, 2).Value < 3 

    ActiveCell.Value = ActiveCell.Value + 1
    
Loop

End Sub

Moving Right One Cell
Add one day to date in cells using VBA

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