need arrow based on cell color

sksanjeev786

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

I need a arrow based on A1 to G11 so what ever we have cell color same color I need in Arrow from A15 (example) including data...

A15 onward arrow should be in color up arrow green and red arrow down and data will remain black




book3
ABCDEFGHIJ
153373816111311RGB RED
2103740131014111460255
310383815713102080
46341441910119800
556394216121511
663314017151212GreenRed
760474322121917
865495527241615
952414117151315
1072405317121416
1158304513151413
12
13
14Output need from A1 to G11
1553 ▲
1655 ▼
1754 ▲
18
Sheet2
Cell Formulas
RangeFormula
H15H15=UNICHAR(9660)
H16H16=UNICHAR(9650)
 
To do this, you must use the "symbol" menu to insert the arrows into any cell. T.K. These are ordinary characters, they need to be copy, go into the cell format and choose the last item "Custom". We write 0 into the line "type" and insert the arrow up next to it. We do the same with another arrow. As a result, you will have two entries with arrows in your user format list. Next, edit conditional formatting rules. To do this, for each of them, install the cell format, I choose the early added "0" with the arrow. Until you indicate the range of cells for which these rules will work. You have in the first rule, formatting will only be applied to cell "A".

Hi,

I have added arrows for 1 and 2 column and after that added formula in Conditional formatting but still not getting
May be I am missing anything...

I know you have spent lot of time on this.... it oky mam you can ignore this......but just wanted to share this ...

thank you so much for your help :)

1732124952855.png
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I have tried with the macro and getting below result

arrow has not applied in all the color cell and I need only 1 space after data.. currently I am getting more space after data...
How are the cells that don't have the arrows colored as I get the below with that XL2BB with normal formatting (as you previously stated), you won't get arrows if you have changed it to conditional formatting.

1732125540823.png
 
Last edited:
Upvote 0
Carefully look at the photo from my post #12. In the list of rules, pay attention to the column "format". I have a number with an arrow there, you do not have this. Select the rule and click "Edit the rule". In the next window below, press the "Format" button. After that, select the first tab, and in it the last item "Custom". In the list, select the format of the number with the arrow you created.
 
Upvote 0
How are the cells that don't have the arrows colored as I get the below with that XL2BB with normal formatting (as you previously stated), you won't get arrows if you have changed it to conditional formatting.
If you have now used conditional formatting (or normal formatting or a mix of the 2) then use the code

VBA Code:
Sub ColorArrow3()
    Dim myCell As Range
    Application.ScreenUpdating = False
   
    For Each myCell In Range("A1:G11")
       
        If myCell.DisplayFormat.Interior.ColorIndex = xlNone Then
            myCell.Offset(14).Value = myCell.Value
        Else
            If myCell.DisplayFormat.Interior.Color = 5296274 Then  '  The RGB you quoted doesn't come out as green to me
                myCell.Offset(14) = myCell.Value & " " & ChrW(9650)
                myCell.Offset(14).Characters(Len(myCell.Offset(14))).Font.Color = 5296274
            Else
                myCell.Offset(14) = myCell.Value & " " & ChrW(9660)
                myCell.Offset(14).Characters(Len(myCell.Offset(14))).Font.Color = 255
            End If
        End If

    Next
   
    Range("A15:G25").HorizontalAlignment = xlLeft

End Sub
 
Upvote 0
Carefully look at the photo from my post #12. In the list of rules, pay attention to the column "format". I have a number with an arrow there, you do not have this. Select the rule and click "Edit the rule". In the next window below, press the "Format" button. After that, select the first tab, and in it the last item "Custom". In the list, select the format of the number with the arrow you created.
Got it...!!

Thank you soooo much for your support on this..

really appreciate your effort on this :)
 
Upvote 0
If you have now used conditional formatting (or normal formatting or a mix of the 2) then use the code

VBA Code:
Sub ColorArrow3()
    Dim myCell As Range
    Application.ScreenUpdating = False
  
    For Each myCell In Range("A1:G11")
      
        If myCell.DisplayFormat.Interior.ColorIndex = xlNone Then
            myCell.Offset(14).Value = myCell.Value
        Else
            If myCell.DisplayFormat.Interior.Color = 5296274 Then  '  The RGB you quoted doesn't come out as green to me
                myCell.Offset(14) = myCell.Value & " " & ChrW(9650)
                myCell.Offset(14).Characters(Len(myCell.Offset(14))).Font.Color = 5296274
            Else
                myCell.Offset(14) = myCell.Value & " " & ChrW(9660)
                myCell.Offset(14).Characters(Len(myCell.Offset(14))).Font.Color = 255
            End If
        End If

    Next
  
    Range("A15:G25").HorizontalAlignment = xlLeft

End Sub
Perfect... !!!

thank you so much sir for your help on this :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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