Hi Chris, I think you may find it easier to simply use countif formulae and use the macro to apply the formula and copy-paste the values. However, as you already have done some work, you could just edit that sub, all you really need is to move away from using column letters and start using cell references. For instance the following code:
For Each obCurCell In Range("D371:D372")
For Each obCurCell2 In Range("C3:C367")
If obCurCell.Value = obCurCell2.Value Then
loX = obCurCell2.Row
Range("D" & loX) = 1
End If
Next
Next
Could be changed to:
Dim i As Integer, j As Integer
For i = 371 To 372
For j = 3 To 367
If Cells(i, 4).Value = Cells(j, 3).Value Then
Cells(j, 4).Value = 1
End If
Next
Next
Then it's a simple case of changing those hard-coded numbers to variables too, i.e. instead of that 4 there, change it to a variable called k (or whatever you like) and put in another for loop of "for k = 4 to 63" (columns D to BK). HTH, if you have any questions, please ask. Regards, Dai
------------------------------------------
Do or do not, there is no try. |
------------------------------------------