0

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?

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Jim is referring to the link at the very top of the URL he sent. Andrew Pitonyak also has a complete book link further down below called "OpenOffice.org Macros Explained.odt V4". In that book, the reference chapter is 15.8.1. Selected cells.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.