Automated merge and format CALC

For example :

I have a 5v x 2h block of cells that I want to merge in order to become a 5v x 1h block with a colour background and border.

Is there anyway I can automate this process?

At the moment I merge the cells manually, then select the section I want and format it with the relevant colour and border. It is very time consuming!

FYI it is for a booking schedule!

You can automate that by saving a macro and setting a hotkey to the macro. You need to enable macro recording in Tools, Options, LibreOffice, General, check the last box “Enable experimental (unstable) features”. Then record the macro (Tools, Macro, Record Macro) by executing the actions that you want to repeat later and then click on Stop Recording.

When the macro is successfully created you can go to Tools, Customize, Keyboard and assign a hotkey to easily repeat the actions.

Thanks for the answer, and this almost works but it doesn’t help if the section I am trying to consolidate is 5v x 4h or any other amount of horizontal cells. I need to find a way that will make it merge all horizontal cells, no matter how many of them there are …

That is another level of macros. That requires programming (not just repeating your recorded actions). For that you need to teach yourself macro programming or find some ready code on the internet (or find someone who can teach you or do it for you for free or for a fee).

Here is a good starting point (see Chapter 12)
http://www.libreoffice.org/get-help/documentation/#cg