Different data with color code...

sksanjeev786

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

Need your support i need the data in Column F format if I get data =>5 or =<5 while calculating column different B-C

book1
ABCDEF
120212020DiffNeed in this formate Only if scores are =5> or =<-5
2
3Are nutritious2228-622 (-6)
4Helps my child lead a healthy lifestyle2430-624 (-6)
5Are a good source of nutrients and/or vitamins1715217
6Are made with natural ingredients1510515 (+5)
7Offer a good variety of flavours34191534 (+15)
8Are great tasting5245752 (+7)
9Brand I trust4343043
Sheet1
Cell Formulas
RangeFormula
D3:D9D3=B3-C3



Thanks
Sanjeev
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Please refer column F for color in diff. score :)
 

Attachments

  • Color data.png
    Color data.png
    9.8 KB · Views: 4
Upvote 0
Are the values in col F hard values or formulae?
 
Upvote 0
Are the values in col F hard values or formulae?

Hey Fluff,

I need the data mentioned in "F" column as of now I have entered manually for the example ,also i have added image as I need color after bracket .

Let me know if you need more info. with this

thanks for checking:)

Regards,
Sanjeev
 
Upvote 0
If you do not my question, I cannot help you. Will col F have a formula in it?
 
Upvote 0
Ok, how about
VBA Code:
Sub sksanjeev()
   Dim Cl As Range
   Dim x As Long
   
   For Each Cl In Range("F3", Range("F" & Rows.Count).End(xlUp))
      If Cl.Offset(, -2) >= 5 Then
         x = InStr(1, Cl.Value, "(")
         Cl.Characters(x, Len(Cl)).Font.Color = vbGreen
      ElseIf Cl.Offset(, -2) <= -5 Then
         x = InStr(1, Cl.Value, "(")
         Cl.Characters(x, Len(Cl)).Font.Color = vbRed
      End If
   Next Cl
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,696
Members
449,048
Latest member
81jamesacct

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