change the color of font

Memar

Board Regular
Joined
Sep 2, 2011
Messages
76
I want to change the color of fonts or cells by matching the date from a different workbook. I have a projection of sales in one workbook and actual sales in a different workbook. Whenever we get the actual total sold product types for the month, I want to deduct those form the projection workbook. Thus, I want to differentiate the by coloring the fonts or changing the color of the cell. Would you please help me how I can do this in Excel?

Data in the first workbook
Projected Sells by month
1/31/20192/28/20193/31/20194/30/20195/31/20196/30/20197/31/2019 TOTAL
Product A 10001000100010001000100010007000
Product B100100100100100100100700
Product C5005005005005005005003500
Product D3003003003003003003002100
Product F6006006006006006006004200
ProductG 2002002002002002002001400

<tbody>
</tbody>


Data in the second workbook
Actual Sales

Accounting date Product Type Amount Sold
1/31/2019Product A 600
1/31/2019Product B100
1/31/2019Product C 100
1/31/2019Product F500
2/28/2019Product C600
2/28/2019Product D400
2/28/2019Product F300
3/31/2019Product A 200
3/31/2019Product B150
3/31/2019Product C500

<tbody>
</tbody>



DESIRED RESULT
1/31/20192/28/20193/31/20194/30/20195/31/20196/30/2019 TOTAL
Product A 10001000100010001000100010007000
Product B100100100100100100100700
Product C5005005005005005005003500
Product D3003003003003003003002100
Product F6006006006006006006004200
ProductG 2002002002002002002001400

<tbody>
</tbody>




Thank you for your help and time.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi Memar,
Warning: I am no expert. But I love trying to color things. I tried this and it works for me.

Code:
Sub colorCodeGreenOrRed()
'
' colorCode
'


'


   If Range("A21") <= 1000 Then
   
   Range("A21").Interior.Color = -16776961
   
   Else
   
   If Range("A21") > 1000 Then
      
   Range("A21").Interior.Color = 5287936
   
   
    
    End If
    End If

end sub



You can run it by applying to a button or manually running it. Macro>Run.

thanks,
Nej
 
Last edited:
Upvote 0
If "1/13/2019" is in B1, you could use Conditional Formatting on B2 with the formula
=(B$1 < MAX(Sheet2!$A:$A) )


Its not clear to me how coloring the cells will help "deduct them from the projection workbook".
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,079
Messages
6,128,687
Members
449,464
Latest member
againofsoul

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