Why can’t I record a Styles macro in LibreOffice? I have created a macro that does all the steps except the part where I have style changes. I have created a Calc document where every other line is colored for easier reading, but unfortunately it does not work to implement in a macro. Kind regards, Thore from Sweden
There is no need for macro, simply define a ⇒Format⇒Conditional Format…
- Formula ⇒ MOD(ROW();2) ⇒ »your style with backcolor«
Taking the original question literally:
The question isn’t precise enough.
- What’s your LibO version? Your OS?
- Describe your steps in detail. Or
- Paste the code as
Preformatterd text
. Or much better - Attach an example file containing your macro.
How do you tell your macro for which cells you want to set a style or cell attributes?
Recording of macros is limitted.
E.g. A selection passed to the macro must be a single cell or a single range.
Hi and thanks, I’ve been away at work and came home today, didn’t think you’d answer so quickly. I think you’ve helped me figure out what the problem is, I have different cell ranges in different documents. But what I do when I make every other row colored is:
- Select the area you want to change.
- Select “Styles” at the top of the menu bar.
- Click on “New Style Fr…”
- Name it ex:everyother
- Click OK.
- Select “Styles” at the top of the menu bar.
- Click on “Manage styles”.
- Hover over “gray” and select “Edit Style” and then the “Background” tab.
- Select Colour->OK
- Format->Contitional->Manage->Add.
- Condition 1->Formula is->ISEVEN(ROW())
- Apply Style->everyother
- OK->OK
- CTRL+A
- Rightklick->Format cells
- Select “Background”->white color.
DONE
Ok, thanks for the tip. But when I have created a cell format, the set is gone the next time I start Libreoffice. So I don’t really understand how to do it, but I’ll google for a guide and it will probably work. Thanks for the help so far.
-------- Originalmeddelande --------
Ola @Thore, para o formato/estilo de célula ficar ativo permanentemente no LibreOffice, creio que deva ser criado e salvo no arquivo padrão.
Hi @Thore, for the cell format/style to be permanently active in LibreOffice, I believe it must be created and saved in the default file.
Create a template and set it as default.
- Add the styles to a blank document.
- Click File - Templates - Save as template
- In the dialogue, give the new template a name, choose a location like My Templates, and tick the box Set as default
If you no longer need it set as default then click File - Templates - Manage templates, find your template, which will have a green tick, right click it and select Reset default
THANK YOU SO MUCH for this guide. I’ll test it as soon as I have time, I’m away working nights. So it will be next week. Kind regards from Thore.
-------- Originalmeddelande --------
THANK YOU for tip. I’ll test it as soon as I have time, I’m away working nights. So it will be next week. Kind regards from Thore.
-------- Originalmeddelande --------