Is there a way to copy font colours to other cells?

Discuss the spreadsheet application
Post Reply
niacin
Posts: 3
Joined: Fri May 19, 2017 11:45 pm

Is there a way to copy font colours to other cells?

Post by niacin »

I'm have a 2 page sheet that I use for my work. The second page is essentially a copy of the first but without cell lines.

In order to make it so I don't have to put the same information twice I have my cells on the second page using "=cell" to copy the text.

I'm wondering if there is a way to have the cell copy font colours as well.
Open Office 3.3
Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Is there a way to copy font colours to other cells?

Post by RusselB »

The only way that I'm aware of is to use the Paste Special (ctrl+shift+V) with the Formats option selected.
Regretfully this means that the colour(s) will stay the same as pasted, even if you change the colours of the supplying cell.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
niacin
Posts: 3
Joined: Fri May 19, 2017 11:45 pm

Re: Is there a way to copy font colours to other cells?

Post by niacin »

I was worried about that.

I want to avoid copy and paste, the idea is to input the info once and it automatically shows up in the designated cell.

I was hoping to get around having to colour code both sides, instead of just sticking to working on the one side.
Open Office 3.3
Windows 10
User avatar
Zizi64
Volunteer
Posts: 11359
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Is there a way to copy font colours to other cells?

Post by Zizi64 »

Use the Cell styles insted of the manual formatting. You can not reference a manually applied property from an another cell directly.

You must use the more advanced tools of the Apache OpenOffice/LibreOffice.

(As you can not reference a manually formatted (shifted) sub- or supercript character. You must use the UNICODE sub an supercript characters if you want to reference a string containing sub- or supercript characters. For example: see the Units [N/m²])

In this case you must use the Cell styles: you can use (apply) them
- manually,
- by a formula,
- by the conditional formatting function,
- by a macro.

And you can create and apply many user defined, parent/child-structured cell styles with colorized fonts, and other desired properties.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
niacin
Posts: 3
Joined: Fri May 19, 2017 11:45 pm

Re: Is there a way to copy font colours to other cells?

Post by niacin »

Thanks for the reply.

I really need to learn more about those kinds of formatting. I'm not very advanced in my Calc skills over all. I will look into the types you mentioned and see if I can get something to work for me.

I appreciate the input.
Open Office 3.3
Windows 10
User avatar
Lupp
Volunteer
Posts: 3549
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Is there a way to copy font colours to other cells?

Post by Lupp »

If you want to assign a specific format to a cell you can use the STYLE() function if the format properties under discussion are "collected" in a named cell style. However, there is not a standard function returning the cell style of a referenced cell. If you accept some complications[1] concerning the way addressing the source cell, it is not difficult to write a user function for the purpose. Se attached demo.

Relying on user code has disadvantages!

[1] User functions don't get access to cells referenced in parameter positions. If a specific cell is needed as an object it must be accessed based on explicit information about the 'Position' or the 'Name' (address as text).
Attachments
aoo88825GetStyleFromAddressedCell_1.ods
(13.56 KiB) Downloaded 158 times
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply