Change Cell Color


New Member
Sep 3, 2008

I am creating a spreadsheet, tracking my stock performance. I would like to have the cell color change automatically to red or green depending on whether the stock price went up or down. I am putting in an up or down arrow within the same cell as the stock price, using the Alt 24 or Alt 25 keys. Example: I have a cell whereby I enter an up arrow (↑), and then a number. If the cell has an up arrow, I'd like it to turn green. A down arrow - red. I hope this makes sense.

Appreciate any help.

Thank you.


Well-known Member
Nov 7, 2006
Normally I'd use CODE() to identify the ASCII character for u/down arrow.
Unfortuantely both characters result in a one character length code of 63.
So there's no way to determine whether the arrow is up or down.

Use Wingdings 3 font and the characters


for down and up. Copy the characters to two blank cells, change the font for those cells to Wingdings 3, then just manually copy and paste the characters to whatever cells you want,
then this as conditional formatting

Select the range

Conditional Formatting
New Rule
Use a formula to determine...

format as green

format as red


MrExcel MVP, Moderator
Jun 12, 2014
Office Version
For the Up arrow use
and down arrow

Change the E3 too the first cell in the applies to range

My Aswer Is This

Well-known Member
Jul 5, 2014
Assuming you will be entering these values in column A of your sheet.
I suggest you use this script. if your stock goes up the cell color will turn green. If the stock price goes down the cell will turn red.

Enter stock price in column A
No need for arrows and pressing Keys

This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/22/2019  11:12:44 AM  EDT
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
If Target.Column = 1 And Target.Row > 1 Then
    If Target.Value < Target.Offset(-1).Value Then Target.Interior.Color = vbRed
    If Target.Value > Target.Offset(-1).Value Then Target.Interior.Color = vbGreen
End If
End Sub

Forum statistics

Latest member
Joaquin Phoenix

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...