如果一次有多个床单的条件

发布于 2025-02-13 17:18:34 字数 889 浏览 0 评论 0原文

我有文档,需要不时更改版本。

当版本1时,一切都可以正常工作,因为给定的工作表之间的链接(整个工作簿中的大约20个)与前表中的某些特定单元格连接。

当我切换到版本2时,我可以将日期和名称(计划者)放在框中。

的右下角更新此框

现在,我想在每个工作表

我尝试过:

 Sub Version2()


 Range("J5").Value = Date

 Columns("J").ColumnWidth = 15
 Columns("J:M").HorizontalAlignment = xlCenter

 a = Application.Worksheets.Count

 For i = 1 To a
 Worksheets(i).Activate
 ActiveSheet.Cells(14, 47).Value = "=Frontsheet!J6"
 Next

 End Sub

 If Range("D38") = 2 Then
 Call Version2
 End If

但是它没有用。只能在没有循环的第一部分工作,

是否有机会使其在整个工作簿中工作?

I have the document, where I need to change the version from time to time.

When version 1 everything works fine because the links between the given worksheets (about 20 across a whole workbook) are connected with some particular cells in the Frontsheet.

When I switch to Version 2 I can put the date and name (Planner) in the box.

enter image description here

Now, I would like to have this box updated in the bottom right corner of every worksheet

enter image description here

I tried:

 Sub Version2()


 Range("J5").Value = Date

 Columns("J").ColumnWidth = 15
 Columns("J:M").HorizontalAlignment = xlCenter

 a = Application.Worksheets.Count

 For i = 1 To a
 Worksheets(i).Activate
 ActiveSheet.Cells(14, 47).Value = "=Frontsheet!J6"
 Next

 End Sub

 If Range("D38") = 2 Then
 Call Version2
 End If

but it didn't work. Works just the first part without the loop

Is there any chance of making it working across a whole workbook?

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

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

发布评论

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

评论(1

云淡风轻 2025-02-20 17:18:35

尝试一下。由于某种原因,在调试器的Au14的手表屏幕上,有14,47个地址出现了。

Sub Version2()
    Range("J5").Value = Date
    
    Columns("J").ColumnWidth = 15
    Columns("J:M").HorizontalAlignment = xlCenter
    
    a = Application.Worksheets.Count
    
    For i = 1 To a
        Worksheets(i).Cells(47, 16).Formula = "=" & Worksheets(1).Name & "!" & Cells(6, 10).Address
    Next
End Sub

Try this. For some reason the 14,47 address was coming up in the watch screen in the debugger as AU14.

Sub Version2()
    Range("J5").Value = Date
    
    Columns("J").ColumnWidth = 15
    Columns("J:M").HorizontalAlignment = xlCenter
    
    a = Application.Worksheets.Count
    
    For i = 1 To a
        Worksheets(i).Cells(47, 16).Formula = "=" & Worksheets(1).Name & "!" & Cells(6, 10).Address
    Next
End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文