Thanks:  0
Likes:  0

1. Why I receive an error at the line:
".Interiorcolor.Index = 2" ?
Can somebody help me?
Many thanks.
While Cells(x, 1).Text <> ""
If Cells(x, 3).Value >= Cells(x, 4).Value Then
With Cells(x, 3)
.Interior.ColorIndex = 6
End With
Else
With Cells(x, 3) And Cells(x, 4) And Cells(x, 5) And Cells(x, 6) And Cells(x, 7) And Cells(x, And Cells(x, 9) And Cells(x, 10)
.Interior.ColorIndex = 2
End With
End If

2. Hi
after this line:

And Cells(x, And Cells(x, 9) And Cells(x, 10)

Should be:

And Cells(x, And Cells(x, 9) And Cells(x, 10) _

Good Day!
Tom

3. On 2002-04-03 02:18, TsTom wrote:
Hi
after this line:

And Cells(x, And Cells(x, 9) And Cells(x, 10)

Should be:

And Cells(x, And Cells(x, 9) And Cells(x, 10) _

Good Day!
Tom
Tom,

I receive still a syntaxis-error at that line afther add the continuation _
Thanks.

4. Hi

You cannot use the With Statement on more than one Object as you have. Change it to:

For i = 3 To 10
Cells(x, i).Interior.ColorIndex = 6
Next i

OR

Range(Cells(x, 3), Cells(x, 10)).Interior.ColorIndex = 6
_________________
Kind Regards
Dave Hawley
Microsoft Excel/VBA Training

[ This Message was edited by: Dave Hawley on 2002-04-03 03:19 ]

5. On 2002-04-03 03:16, Dave Hawley wrote:
Hi

You cannot use the With Statement on more than one Object as you have. Change it to:

For i = 3 To 10
Cells(x, i).Interior.ColorIndex = 6
Next i

OR

Range(Cells(x, 3), Cells(x, 10)).Interior.ColorIndex = 6
_________________
Kind Regards
Dave Hawley
Microsoft Excel/VBA Training

[ This Message was edited by: Dave Hawley on 2002-04-03 03:19 ]
Can you tell me,is it possible that:Range(Cells(x, 3), Cells(x,10)).Interior.ColorIndex = 6

Cells(X,10) could be the last empty column otherwise I must change each time the number 10 to 11 or 12 or 13 .....
Many thanks.

6. Try this, I think it's what you want.

Code:
`Range(Cells(x, 3), Cells(x, 256).End(xlToLeft)).Interior.ColorIndex = 6`

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•