|
-
Jul 12th, 2005, 02:55 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Comparing values in one column
Hi!
I really need some help to this!
I have a column in which I want to compare values. First the cell B2 need comparison with other cells and if there is a match - it colors both cells red.
Then it's B3's turn for comparison and so on. This is what I've got so far:
Sub Drwcheck()
Dim iCompare As Long
Dim iCheck As Long
Dim XL As Variant
Dim xlWS As Variant
Dim Checksum As Integer
Dim Compare As Integer
Dim Chk As Integer
Set xlWS = ActiveSheet
Dim colXLparams As New Collection
iCompare = 3
iCheck = 2
Chk = 0
Do While xlWS.Cells(iCompare, 2).Value <> ""
Checksum = Cells(iCheck, 2)
Compare = Cells(iCompare, 2)
If Checksum = Compare Then GoTo Paint Else
iCompare = iCompare + 1
Loop
Paint:
MsgBox "Fejl!!", vbCritical
With Cells(iCheck, 2).Interior
.Color = RGB(255, 0, 0)
End With
With Cells(iCompare, 2).Interior
.Color = RGB(255, 0, 0)
End With
End Sub
But it only compares the first cell :s
Help me, please
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
|