Colour Coding Concatenation?

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
291
Office Version
  1. 365
Platform
  1. Windows
Hi Folks - Thanks for having a look at this - appreciated.

Is there a way to concatenate two cells using concatenate(A2,B2) and to assign a colour to either value.

I've been trying concatenate([red]A2,B2) but it is not working.

Any help appreciated.

Thanks - Mark.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
We use conditional formatting.
Book1
ABC
2NoWarNo War
Sheet2
Cell Formulas
RangeFormula
C2C2=A2&" "&B2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2Celldoes not contain a blank value textNO
 
Upvote 0
Hi Sergius - Thanks for looking at this.

Is there a way to have the "No War" as follows "No War"
 
Upvote 0
Due to the fact that in the cell B2 the formula will not work.
 
Upvote 0
I think you will need a macro to do what you want. Try:
VBA Code:
Sub JoinData()
    Application.ScreenUpdating = False
    Dim v As Variant, i As Long, rng As Range, x As Long
    v = Range("A2", Range("A" & Rows.Count).End(xlUp)).Resize(, 2).Value
    ReDim arr(1 To UBound(v))
    For i = LBound(v) To UBound(v)
        arr(i) = v(i, 1) & " " & v(i, 2)
    Next i
    Range("C2").Resize(UBound(v)) = Application.Transpose(arr)
    For Each rng In Range("C2", Range("C" & Rows.Count).End(xlUp))
        x = InStr(1, rng.Value, " ", vbTextCompare)
        rng.Characters(1, x).Font.Color = vbRed
    Next rng
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,226,091
Messages
6,188,856
Members
453,504
Latest member
Juanp89

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top