我如何获得页面的第一个单元格地址

发布于 2025-02-14 01:56:17 字数 266 浏览 0 评论 0原文

我想在Excel上使用“单元格”公式来获取页面第一个单元格的地址。

例如: 当我输入此公式时,

=CELL("address";Page1)

它将具有这样的输出

A1

,当我输入此公式时,

=CELL("address";Page2)

它将具有这样的输出

A21

I want to use the "CELL" formula on excel to get address of the first cell of the page.

for example:
when I input this formula

=CELL("address";Page1)

it will have output like this

A1

and when I input this formula

=CELL("address";Page2)

it will have output like this

A21

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

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

发布评论

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

评论(1

伪装你 2025-02-21 01:56:17

解决了,我创建了自己的代码来解决我的问题

Function FirstPageCell(thepage As String) As String
' Get the first cell of the page

    Dim wks As Worksheet
    Dim iPage As Integer
    Dim iHorPgs As Integer
    Dim iHP As Integer
    Dim lRow As Long

    Set wks = ActiveSheet
    iHorPgs = wks.HPageBreaks.Count + 1



    iPage = thepage
    
    iHP = ((iPage - 1) Mod iHorPgs)

    If iHP = 0 Then
        lRow = 1
    Else
        lRow = wks.HPageBreaks(iHP).Location.Row
    End If

    
    FirstPageCell = ("A" & lRow)
End Function

信用:
https://excel.tips.net/T005823_Jumping_To_a_Specific_Page.html

Solved, I've created my own code that solve my question

Function FirstPageCell(thepage As String) As String
' Get the first cell of the page

    Dim wks As Worksheet
    Dim iPage As Integer
    Dim iHorPgs As Integer
    Dim iHP As Integer
    Dim lRow As Long

    Set wks = ActiveSheet
    iHorPgs = wks.HPageBreaks.Count + 1



    iPage = thepage
    
    iHP = ((iPage - 1) Mod iHorPgs)

    If iHP = 0 Then
        lRow = 1
    Else
        lRow = wks.HPageBreaks(iHP).Location.Row
    End If

    
    FirstPageCell = ("A" & lRow)
End Function

Credit:
https://excel.tips.net/T005823_Jumping_To_a_Specific_Page.html

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