VBA 5 different colours CF to highlights A, B, C, D and E

Kishan

Well-known Member
Joined
Mar 15, 2011
Messages
1,648
Office Version
  1. 2010
Platform
  1. Windows
Using</SPAN></SPAN> Excel 2000</SPAN>

Hi,</SPAN>

I want to join multiple cells C:P columns, into single column R for that using formula getting the result as below</SPAN></SPAN>


Book1
ABCDE
1
2
3
4P1
5A
6
7
8
9
10
11
12
13
14
15
16B
17
18
19
20
21A
22
23
24
25
26C
27
28
29
30
31
32D
33
34
35E
36B
37
38
39
40
41
42
43
44
45C
46
47
48
49
50
51D
52
53
54E
55C
56
57
58
59
60
61D
62
63
64E
65D
66
67
68E
69
70B
71
72
73
74
75
76
77
Sheet15


Thank you in advance</SPAN></SPAN>

Regards</SPAN></SPAN>,</SPAN>
Kishan</SPAN></SPAN>
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hi,</SPAN></SPAN>

I am reading my post#1 thinking it is not clear what I need</SPAN></SPAN>

I want to have colour for A = Red </SPAN></SPAN>
I want to have colour for B = Blue </SPAN></SPAN>
I want to have colour for C = Dark Green </SPAN></SPAN>
I want to have colour for D = Pink </SPAN></SPAN>
I want to have colour for E = Dark Brown </SPAN></SPAN>
And the font white for all A, B, C, D & E</SPAN></SPAN>

Regards,</SPAN></SPAN>
Kishan</SPAN></SPAN>
 
Upvote 0
Using</SPAN></SPAN> Excel 2000</SPAN>

Hi,</SPAN>

I want to join multiple cells C:P columns, into single column R for that using formula getting the result as below</SPAN></SPAN>

Thank you in advance</SPAN></SPAN>

Regards</SPAN></SPAN>,</SPAN>
Kishan</SPAN></SPAN>
Hi, found a code under the link below modifying it solve my query here it is may help someone.
https://www.mrexcel.com/forum/excel...al-formatting-multiple-cases.html#post5135670</SPAN></SPAN>
Code:
'https://www.mrexcel.com/forum/excel-questions/1069270-vba-conditional-formatting-multiple-cases.html#post5135670
'VBA - Conditional Formatting multiple cases
Sub ResetFormatting_1()
For Each ar In Range("C5:C100").Areas
    
    For Each Cell In ar
        
            Select Case Cell
                Case "A"
                     Cell.Interior.ColorIndex = 3
                     Cell.Font.ColorIndex = 2
                     
                     
                Case "B"
                     Cell.Interior.ColorIndex = 5
                     Cell.Font.ColorIndex = 2
                
                Case "C"
                     Cell.Interior.ColorIndex = 10
                     Cell.Font.ColorIndex = 2
                
                Case "D"
                     Cell.Interior.ColorIndex = 7
                     Cell.Font.ColorIndex = 2
                    
                Case "E"
                    Cell.Interior.ColorIndex = 9
                     Cell.Font.ColorIndex = 2
                
            End Select
           
        Next Cell
Next ar
 
End Sub

Regards,
</SPAN></SPAN>
Kishan
</SPAN></SPAN>
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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