我一直在搜索,但几乎找不到关于 LibreOffice Basic 的信息
我有点习惯在 excel 中编写宏,但这次需要做一个循环,直到我到达第一个空列并且它需要在 libreoffice 中。
在 excel 我会做这样的事情:
Dim i As integer
i = 0
Range("A1").Select
While cell.Offset(0, i).Value <> Null
i = i + 1
Wend
MsgBox ("First empty column is " & Chr(i + 64))
但在 libreoffice 我不知道。
谁能帮我。
谢谢,
布鲁诺
最佳答案
我设法通过这种方式找到了答案:
dim cell as object
dim i as integer
i = 0
cell = Sheet.getCellByPosition(i,0)
while Cell.Type <> com.sun.star.table.CellContentType.EMPTY
i = i+1
cell = Sheet.getCellByPosition(i,0)
wend
当循环结束时,我得到变量
i
对应于列号。然后我可以像在 excel 中一样将其转换为字母(chr 函数)
关于macros - Libreoffice 计算 : loop throught cells macro,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19580895/