Fill D1:D4 format all the way below

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,371
Office Version
  1. 2010
Hello,

Here is original data


Book1
CDE
1A - A
2A - B
3C - A
4C - C
5
6C - A
7C - C
8C - A
9A - A
10A - B
11C - A
12C - A
13A - B
14A - A
15A - B
16C - A
17A - A
18A - A
19C - A
20A - A
21A - A
22A - A
23A - A
24C - A
25A - A
26C - A
27C - C
28A - B
29C - C
30C - C
31A - A
32
Hoja1


I want to fill D1:D4 format as per text find all the way below D6 to end of the column

Example after i want it looks like as below


Book1
CDE
1A - A
2A - B
3C - A
4C - C
5
6C - A
7C - C
8C - A
9A - A
10A - B
11C - A
12C - A
13A - B
14A - A
15A - B
16C - A
17A - A
18A - A
19C - A
20A - A
21A - A
22A - A
23A - A
24C - A
25A - A
26C - A
27C - C
28A - B
29C - C
30C - C
31A - A
32
Hoja2


Thank you all

Excel 2000
Regards,
Moti
 
You are welcome.

The "C - C" font color was black (automatic) on my test sheet,
but here is a modified version that explicitly sets the font color to black:
Code:
Sub ColorCell()
    For Each cll In Range("D1:D" & Range("D" & Rows.Count).End(xlUp).Row)
        With cll
            .Font.Color = vbBlack
            Select Case .Value
                Case "A - A": .Interior.Color = vbGreen
                Case "C - C": .Interior.Color = vbRed
                Case "A - B": .Interior.Color = vbGreen
                    .Characters(Start:=5, Length:=1).Font.Color = vbRed
                Case "C - A": .Interior.Color = vbRed
                    .Characters(Start:=1, Length:=1).Font.Color = vbWhite
                    .Characters(Start:=5, Length:=1).Font.Color = vbGreen
            End Select
        End With
    Next cll
End Sub
Tetra201, all is working fine!!

Thank you for your help

Regards,
Moti
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

Forum statistics

Threads
1,216,113
Messages
6,128,904
Members
449,477
Latest member
panjongshing

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