S
ste mac
Hi, I have a lot of records to search thru', everything works fine,
its just this section of code below is far too slow.
Is there any way to make this section of code work at sub light speed
or even light speed?
thanks for any help
Ste
Do While Not (Sheets("Meetingstodate").Cells(xlrow, 2).Value = "")
Set StartCell = Sheets("Meetingstodate").Cells(xlrow, 2)
Set EndCell = Sheets("Meetingstodate").Cells(xlrow, 7)
For Each cell In Range(StartCell, EndCell)
If cell.Value = A Then
intcounter1 = 1
End If
If cell.Value = B Then
intcounter2 = 1
End If
If cell.Value = C Then
intcounter3 = 1
End If
If cell.Value = D Then
intcounter4 = 1
End If
If cell.Value = E Then
intcounter5 = 1
End If
If cell.Value = F Then
intcounter6 = 1
End If
Next cell
If intcounter1 + intcounter2 + intcounter3 + intcounter4 + intcounter5
+ intcounter6 >= 5 Then
totcounter = totcounter + 1
End If
xlrow = xlrow + 1
Loop
its just this section of code below is far too slow.
Is there any way to make this section of code work at sub light speed
or even light speed?
thanks for any help
Ste
Do While Not (Sheets("Meetingstodate").Cells(xlrow, 2).Value = "")
Set StartCell = Sheets("Meetingstodate").Cells(xlrow, 2)
Set EndCell = Sheets("Meetingstodate").Cells(xlrow, 7)
For Each cell In Range(StartCell, EndCell)
If cell.Value = A Then
intcounter1 = 1
End If
If cell.Value = B Then
intcounter2 = 1
End If
If cell.Value = C Then
intcounter3 = 1
End If
If cell.Value = D Then
intcounter4 = 1
End If
If cell.Value = E Then
intcounter5 = 1
End If
If cell.Value = F Then
intcounter6 = 1
End If
Next cell
If intcounter1 + intcounter2 + intcounter3 + intcounter4 + intcounter5
+ intcounter6 >= 5 Then
totcounter = totcounter + 1
End If
xlrow = xlrow + 1
Loop