|
-
Jul 14th, 2005, 05:57 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Magic?
Got a little prob with my comparison:
I've got one, single number with no matches - still, it turns red. But no other single-numbers turn red! Here's the code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim iCompare As Long
Dim iCheck As Long
Dim XL As Variant
Dim xlWS As Variant
Dim Checksum As Long
Dim Compare As Long
Set xlWS = ActiveSheet
Dim colXLparams As New Collection
iCompare = 3
iCheck = 2
Do While xlWS.Cells(iCheck, 3).Value <> ""
Do While xlWS.Cells(iCompare, 3).Value <> ""
Checksum = Cells(iCheck, 2)
Compare = Cells(iCompare, 2)
If Checksum = Compare Then
With Cells(iCheck, 3).Interior
.Color = RGB(255, 0, 0)
End With
With Cells(iCompare, 3).Interior
.Color = RGB(255, 0, 0)
End With
iCompare = iCompare + 1
Else
With Cells(iCheck, 3).Interior
.Color = RGB(255, 0, 0)
End With
With Cells(iCompare, 3).Interior
.Color = RGB(255, 255, 255)
End With
iCompare = iCompare + 1
End If
Loop
iCompare = iCheck + 2
iCheck = iCheck + 1
Loop
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|