S
Sam
I get a compile error on line 21 below. What is wrong with it?
I am trying to color fill a cell based on the XColor value...
Help!
0 r = 1
1 Do While ActiveSheet.Cells(r, 1) <> ""
2 str1 = ActiveSheet.Cells(r, 1)
3 str2 = ActiveSheet.Cells(r, 2)
4 comp1 = strip(str1)
5 comp2 = strip(str2)
6
7 If (comp1 <> comp2) Then
8 XColor = 5
9 Else
10 XColor = 25
11 End If
12
13 If (XColor) Then
14 Range("ActiveSheet.Cells(r, 1):ActiveSheet.Cells(r, 2)").Select
15 With Selection.Interior
16 .ColorIndex = 3
17 .Pattern = xlSolid
18 End With
19 End If
20 r = r + 1
21 Loop
I am trying to color fill a cell based on the XColor value...
Help!
0 r = 1
1 Do While ActiveSheet.Cells(r, 1) <> ""
2 str1 = ActiveSheet.Cells(r, 1)
3 str2 = ActiveSheet.Cells(r, 2)
4 comp1 = strip(str1)
5 comp2 = strip(str2)
6
7 If (comp1 <> comp2) Then
8 XColor = 5
9 Else
10 XColor = 25
11 End If
12
13 If (XColor) Then
14 Range("ActiveSheet.Cells(r, 1):ActiveSheet.Cells(r, 2)").Select
15 With Selection.Interior
16 .ColorIndex = 3
17 .Pattern = xlSolid
18 End With
19 End If
20 r = r + 1
21 Loop