用宏观造型细胞

发布于 2025-02-09 09:16:05 字数 413 浏览 3 评论 0 原文

我是新的OO CALC宏。使用此代码,我可以在 f13:f16 范围上进行样式单元格,

REM  *****  BASIC  *****
Option Explicit

Sub Main
oDoc = ThisComponent
osheets = odoc.getSheets()
osheet = osheets.getByIndex(0)
oCells = oSheet.getCellRangeByName("F13:F16")
NewBorder = oCells.BottomBorder
NewBorder.OuterLineWidth = 3
oCells.BottomBorder = NewBorder
End Sub

如何编辑此代码,以便我可以使用鼠标选择当前选择的单元格,而不是在代码中指定它们?

I'm new with OO Calc macros. With this code I can style cells on F13:F16 range

REM  *****  BASIC  *****
Option Explicit

Sub Main
oDoc = ThisComponent
osheets = odoc.getSheets()
osheet = osheets.getByIndex(0)
oCells = oSheet.getCellRangeByName("F13:F16")
NewBorder = oCells.BottomBorder
NewBorder.OuterLineWidth = 3
oCells.BottomBorder = NewBorder
End Sub

How can I edit this code so I can style cells I currently selected with mouse, instead of specifying them in the code?

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

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

发布评论

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

评论(1

枕头说它不想醒 2025-02-16 09:16:05

使用选定的单元格是有点复杂的,因为可以选择单个单元格,一个单元格范围或多个细胞范围。

在Essential

Working with selected cells is a bit complex because either a single cell, a cell range, or multiple cell ranges may be selected.

Code that handles all of these possibilities is explained in the essential Andrew's Macro Document under section 6.5.1. Simple example processing selected cells.

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