Change colour of some of a cell only (through formula)

FrankieGTH

New Member
Joined
May 29, 2021
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

Here is a screenshot of what I have.

Problem.png


I would like to make the brackets red or green, green if a person has gone up, red if a person has gone down (or black if no change). The only way I can of doing this is copy and pasting as values, then manually colouring in each one.

Looking To Achieve.png


Is there a way of achieving this through formula or VBA? I have several tables to do, hence the requirement to automate the process.

Kind Regards
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Try this:

VBA Code:
Sub Ranks()
  Dim i As Long, ini As Long
  Dim c As Range
  
  Range("A:A").Font.Color = vbBlack
  For Each c In Range("C2", Range("C" & Rows.Count).End(3))
    With Range("A" & c.Row)
      .Value = c & " (" & c.Offset(, 1) - c & ")"
      ini = Len(c) + 2
      If c < c.Offset(, 1) Then .Characters(ini, 9).Font.Color = -6112221
      If c > c.Offset(, 1) Then .Characters(ini, 9).Font.Color = vbRed
    End With
  Next
End Sub
 
Upvote 0
Solution
I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,840
Messages
6,127,217
Members
449,370
Latest member
kaiuuu

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