Merging text from different cells and keeping the format

Viewed 60

Is it possible to copy information from mutiple cells, to one cell and keep the formatting? as an example, I have A1=Hello (Green, bold font), A2, World (red font)

Want to have B2=Hello World (with words in different color).

Looking for a solution in Google Sheets, but as an alternative, Excel would also work

2 Answers

For example my activecell has word "bankeris", so I made first 3 letters one color and another 3 letters with other color. This code is via "Macro recording". So copy/paste will do same.

With ActiveCell.Characters(Start:=1, Length:=3).Font
        .Name = "Calibri"
        .FontStyle = "Regular"
        .Size = 11
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .Color = -16776961
        .TintAndShade = 0
        .ThemeFont = xlThemeFontMinor
    End With
    With ActiveCell.Characters(Start:=4, Length:=3).Font
        .Name = "Calibri"
        .FontStyle = "Regular"
        .Size = 11
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorAccent6
        .TintAndShade = -0.249977111117893
        .ThemeFont = xlThemeFontMinor
    End With

Thank you Bankeris.

The solution I need is a bit different - the number of characters will be variable, I purely need to copy the format from the original cell.

To give a big picture - there is a table with approx 8 columns, each column will have its color, but the numbers of characters in the cell will be different. The goal if to create a sentence which will include information from the specified row...but the format of each word in the sentence needs to be the same as in the original table.

Potentially, this solution could be used, but the number of chars for each color would need to be identified from te original cell and put as a variable in the code

Related