簡體   English   中英

如何讓單元格在 LibreOffice Calc 中顯示表格名稱?

[英]How to have a cell display the table's name in LibreOffice Calc?

所以,基本上我想讓一個單元格顯示它所在的表的名稱。我想出了如何獲取表 ID,從 1 開始,但不知道如何獲取它的名稱。

AFAIK,你不能直接得到名字。 但是您可以使用帶有filename參數的CELL function來獲取包含當前單元格的路徑、文件名和表名的字符串。 使用該字符串,您可以按如下方式提取表名:

=RIGHT(CELL("filename");LEN(CELL("filename"))-FIND("$";CELL("filename")))

拆分多行:

 =RIGHT(                    # return substring from the right
     CELL("filename");      # of the filename (incl. table name)
     LEN(                   # calculate the length of the table name substring:
          CELL("filename")  # take the complete filename string;
      ) -                   # and subtract ...
      FIND(                 # the position...
          "$";              # of the dollar sign (preceding the table name)
          CELL("filename")  # of the "filename" string
      )
  )

靈感來自 villeroyOOo 論壇帖子

根據您的本地化,您可能需要替換分號; 用逗號, .

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM