Add color in symbol

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
884
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team,

Need to add color in arrow only with Green and Red

01 FS Grouping_Fix Macro.xlsx
ABCDEFGHIJKLMN
1
2
3ABCXABCX
4
5SEEN AD (NET)19 ▼1522 ▼16SEEN AD (NET)19 X1522 X16
6Correctly Branded (net)3.87 ▼3.674.09 ▼3.68Correctly Branded (net)3.87 X3.674.09 X3.68
7The Ad Is Likeable3.153.143.173.19The Ad Is Likeable3.153.143.173.19
8The Ad Told Me Something New2.83 ▲2.842.832.92 AThe Ad Told Me Something New2.832.842.832.92 A
9Top 2 Box (net)2.75 ▲2.69 ▲2.82 ▲2.95 ABCTop 2 Box (net)2.752.692.822.95 ABC
10Top 2 Box (net)2.912.992.84 Top 2 Box (net)2.912.992.84
11
12The Ad Is Likeable3.27 ▼3.23.353.25The Ad Is Likeable3.27 X3.203.353.25
13The Ad Told Me Something New3 ▲2.97 ▲3.04 ▲3.22 ABCThe Ad Told Me Something New3.002.973.043.22 ABC
14It Made Me Want To Visit The Dealership Or Take A Test Drive2.93 ▲2.9 ▲2.97 ▲3.16 ABCIt Made Me Want To Visit The Dealership Or Take A Test Drive2.932.902.973.16 ABC
15The Ad Made Me Want To Find Out More About The Vehicle (search Online/read Articles)3.323.263.37 The Ad Made Me Want To Find Out More About The Vehicle (search Online/read Articles)3.323.263.37
16The Ad Made Me Want To Find Out More About The Brand3.143.153.13 The Ad Made Me Want To Find Out More About The Brand3.143.153.13
17This Is The Sort Of Ad I Would Talk To Others About3.07 ▲3.08 ▲3.05 ▲3.28 ABCThis Is The Sort Of Ad I Would Talk To Others About3.073.083.053.28 ABC
grouping
Cell Formulas
RangeFormula
D5:G10,D12:G17D5=SUBSTITUTE(K5,"X","")&" "&IFERROR(IF(FIND(D$3,$N5),$A$2,""),"")&IFERROR(IF(FIND($G$3,K5),$A$3,""),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K5:M27Expression=FIND($N$3,K5)textNO
K5:M27Expression=FIND(K$3,$N5)textNO
H5:I26Expression=FIND("M",#REF!)textNO
H5:I26Expression=FIND("N",#REF!)textNO


Regards,
Sanjeev
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Under what conditions are you wanting to set the color of the arrow to red or green? Post some code you have for the arrows.
 
Upvote 0
If by "arrows" you mean those up and down pointing triangles... no, you will not be able to color them unless you color the text that is in the cell with them. Your values are the result of formulas... ONLY text constants can have parts of their text colored (or formatted for that matter) differently from the rest of the text in the cell... and even then, that can only be done manually or by VBA code.
 
Upvote 0
If by "arrows" you mean those up and down pointing triangles... no, you will not be able to color them unless you color the text that is in the cell with them. Your values are the result of formulas... ONLY text constants can have parts of their text colored (or formatted for that matter) differently from the rest of the text in the cell... and even then, that can only be done manually or by VBA code.


Yes, sir Looking for a Macro in which I need color for arrows only.
 
Upvote 0
Under what conditions are you wanting to set the color of the arrow to red or green? Post some code you have for the arrows.

Hello Sir,

Looking for a macro for arrow only:)

Regards,
Sanjeev
 
Upvote 0
Do you need to keep the formulas in Columns D through G? The reason I ask is because the only way a macro could work is if it replaced all of your formulas with the text values they are displaying (your formulas would no longer exist). If you need to keep the action your formulas are doing, then it MIGHT be possible to remove all of them and use VBA event code to perform the same action the formulas do.
 
Upvote 0
Do you need to keep the formulas in Columns D through G? The reason I ask is because the only way a macro could work is if it replaced all of your formulas with the text values they are displaying (your formulas would no longer exist). If you need to keep the action your formulas are doing, then it MIGHT be possible to remove all of them and use VBA event code to perform the same action the formulas do.
Hello Sir,

Thanks for chekcing

I need only Arrow color need to be changed where ever I have up (green) and Down (Red) between D to F column only and rest will be same with data only color of arrow will change :)

Regards,
Sanjeev
 
Upvote 0
Do you need to keep the formulas in Columns D through G? The reason I ask is because the only way a macro could work is if it replaced all of your formulas with the text values they are displaying (your formulas would no longer exist). If you need to keep the action your formulas are doing, then it MIGHT be possible to remove all of them and use VBA event code to perform the same action the formulas do.

Yes, Sir we can do that we can copy data from C to G and will copy in other columns with Text as you have mentioned above and apply the macro.
 
Upvote 0
See if this satisfies you:

VBA Code:
Sub InsertColumnsAndTriangles()                                         ' Up triangle = ChrW(9650) ... Down triangle = ChrW(9660) <-- Decimal values of the Hex
'                                                                       ' Up triangle = Unicode Hex 25B2 ... Down triangle = Unicode Hex 25BC
    Dim LastRow As Long
    Dim Cel     As Range
    Dim WS      As Worksheet
'
    Set WS = Sheets("Sheet1")                                           ' <--- Change to actual sheet name desired
''
    WS.Range("G:G, F:F, E:E").Insert                                    ' Insert 3 new columns
    WS.Range("E:E, G:G, I:I").ColumnWidth = 2.43                        ' set the column width for the 3 new columns
'
    WS.UsedRange.EntireColumn.AutoFit                                   ' Resize columns to fit headers/data
''
    LastRow = WS.Range("D" & Rows.Count).End(xlUp).Row                  ' Find the row of the last line of data in Column D
'
    For Each Cel In WS.Range("D1:H" & LastRow)
        If Right(Cel.Value, 2) = " " & ChrW(9650) Then                  ' If cell ends with a space and an up triangle then ...
            Cel.Value = Left(Cel.Value, Len(Cel.Value) - 2)             '   Remove the end space and triangle from the cell
            WS.Cells(Cel.Row, Cel.Column + 1) = ChrW(9650)              '   Place an up triangle in the column to the right of it
            WS.Cells(Cel.Row, Cel.Column + 1).Font.Color = vbGreen      '   Color the triangle Green
'
        ElseIf Right(Cel.Value, 2) = " " & ChrW(9660) Then              ' If cell ends with a space and a down triangle then ...
            Cel.Value = Left(Cel.Value, Len(Cel.Value) - 2)             '   Remove the end space and triangle from the cell
            WS.Cells(Cel.Row, Cel.Column + 1) = ChrW(9660)              '   Place a down triangle in the column to the right of it
            WS.Cells(Cel.Row, Cel.Column + 1).Font.Color = vbRed        '   Color the triangle Red
        End If
    Next
End Sub
 
Upvote 0
See if this satisfies you:

VBA Code:
Sub InsertColumnsAndTriangles()                                         ' Up triangle = ChrW(9650) ... Down triangle = ChrW(9660) <-- Decimal values of the Hex
'                                                                       ' Up triangle = Unicode Hex 25B2 ... Down triangle = Unicode Hex 25BC
    Dim LastRow As Long
    Dim Cel     As Range
    Dim WS      As Worksheet
'
    Set WS = Sheets("Sheet1")                                           ' <--- Change to actual sheet name desired
''
    WS.Range("G:G, F:F, E:E").Insert                                    ' Insert 3 new columns
    WS.Range("E:E, G:G, I:I").ColumnWidth = 2.43                        ' set the column width for the 3 new columns
'
    WS.UsedRange.EntireColumn.AutoFit                                   ' Resize columns to fit headers/data
''
    LastRow = WS.Range("D" & Rows.Count).End(xlUp).Row                  ' Find the row of the last line of data in Column D
'
    For Each Cel In WS.Range("D1:H" & LastRow)
        If Right(Cel.Value, 2) = " " & ChrW(9650) Then                  ' If cell ends with a space and an up triangle then ...
            Cel.Value = Left(Cel.Value, Len(Cel.Value) - 2)             '   Remove the end space and triangle from the cell
            WS.Cells(Cel.Row, Cel.Column + 1) = ChrW(9650)              '   Place an up triangle in the column to the right of it
            WS.Cells(Cel.Row, Cel.Column + 1).Font.Color = vbGreen      '   Color the triangle Green
'
        ElseIf Right(Cel.Value, 2) = " " & ChrW(9660) Then              ' If cell ends with a space and a down triangle then ...
            Cel.Value = Left(Cel.Value, Len(Cel.Value) - 2)             '   Remove the end space and triangle from the cell
            WS.Cells(Cel.Row, Cel.Column + 1) = ChrW(9660)              '   Place a down triangle in the column to the right of it
            WS.Cells(Cel.Row, Cel.Column + 1).Font.Color = vbRed        '   Color the triangle Red
        End If
    Next
End Sub

Thank you so much for your help in this :)
Just wanted to check can we get those arrows in the same cell given in the below example I have kept the image as attached with color arrow

Book1
ABCDEFG
1
2
3ABCX
4
5SEEN AD (NET)19 ▼1522 ▼16
6Correctly Branded (net)3.87 ▼3.674.09 ▼3.68
7The Ad Is Likeable3.153.143.173.19
8The Ad Told Me Something New2.83 ▲2.842.832.92 A
9Top 2 Box (net)2.75 ▲2.69 ▲2.82 ▲2.95 ABC
10Top 2 Box (net)2.912.992.84
11
12The Ad Is Likeable3.27 ▼3.23.353.25
13The Ad Told Me Something New3 ▲2.97 ▲3.04 ▲3.22 ABC
14It Made Me Want To Visit The Dealership Or Take A Test Drive2.93 ▲2.9 ▲2.97 ▲3.16 ABC
15The Ad Made Me Want To Find Out More About The Vehicle (search Online/read Articles)3.323.263.37
16The Ad Made Me Want To Find Out More About The Brand3.143.153.13
17This Is The Sort Of Ad I Would Talk To Others About3.07 ▲3.08 ▲3.05 ▲3.28 ABC
Sheet2
 

Attachments

  • Arrow.png
    Arrow.png
    22.4 KB · Views: 7
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,869
Members
449,192
Latest member
MoonDancer

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