Ask Your Question

How to Record a Macro in Calc That Select the Cell to The Left?

asked 2019-08-01 18:38:29 +0200

israeltandrade gravatar image

updated 2019-08-01 18:40:03 +0200

I am trying to record a macro in Calc that selects the cell to the left of the button, shifts up to two cells further to the left, applies the overwritten landing to the letters, and changes the font color. Everything works fine, the problem is that if I apply the same macro to another button it changes the cells of the previous button. That is, you would have to record a different macro for each line. Is there a way around this and make Libreoffice understand that just follow the procedure with the cell immediately to the left of the cell where the button is?

edit retag flag offensive close merge delete


Same question posted on OpenOffice forum

robleyd gravatar imagerobleyd ( 2019-08-02 01:55:30 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2019-08-02 18:01:33 +0200

Lupp gravatar image

updated 2019-08-02 18:02:53 +0200

Quoting @israeltandrade: "..., shifts up to two cells further to the left, applies the overwritten landing to the letters, and ..."
Don't understand. Will ignore this part.
Quoting @israeltandrade: "I am trying to record a macro in Calc..."
Why? You will need to rework a recorded macro to significant depth for such purposes anyway. Better develop it from scratch then. If unavoidable you can use the "slot machine" made for recorded macros also in fully written ones.

In pursuit of this question I experienced that the LibreOffice API actually is very unhandy concerning the task to get the Shape containing a FormControl, and this way to get the Anchor. In fact my solution relies on shifting through the DrawPage, and thus on a working implementation of EqualUnoObjects(). Concerning this function there is the pending bug tdf#125421. The function seems to work, however, for the purpose under diskussion here.

If somebody is actually interested in what I did this attached example should help though the code is rather rough. If it satisfies the OriginalQuestioner's expctations was not in my focus insofar.

No recording of such a macro possible as far as I can see.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-08-01 18:38:29 +0200

Seen: 39 times

Last updated: Aug 02