how to give uniquie number to cells containing same color

genetist

Board Regular
Joined
Mar 29, 2013
Messages
75
Office Version
  1. 2016
Platform
  1. Windows
Hi to all,
I have excel sheet which contains cells with different color and i want to give 1 number to all cella containing blue color and 2 for red like this. How can i approach to solve this problem? is if conditions will work for it? or i have to go for macros? please help me
Thanks in advance,
Regards,
Genetist
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
please upload a sample file (with current data and desired result) on a sharing site, then paste the link here
 
Upvote 0

Excel 2010
ABC
13
244
343
4
5
643
73
Sheet1
Cell Formulas
RangeFormula
B1=Cell_Colour(A1)
B2=Cell_Colour(A2)
B3=Cell_Colour(A3)
C6=Cell_Colour(C6)
C7=Cell_Colour(C7)


Code:
Function Cell_Colour(ByVal Target As Range)
Cell_Colour = Target.Cells.Interior.ColorIndex
End Function
 
Upvote 0

Forum statistics

Threads
1,203,329
Messages
6,054,756
Members
444,748
Latest member
knowak87

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