View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Christy Christy is offline
external usenet poster
 
Posts: 89
Default Anouther loop question

WOW - those last answers not only worked well but were som mcuh faster that
my code - I LOVE this forum!!!

Below is anouther loop I am using - it works but is slow and inefficient -
any suggestions for improvement would be muxh appreciated. Not sure how to
impliment the 'used range' and 'no selection' tips here.

Sub ProcessCountHistory()
Dim i As Integer

For i = 7 To 7500
Cells(i, 15).Select
If ActiveCell.Value = "" Then
If ActiveCell.Offset(-1, 0).Value = "YES" Then
If ActiveCell.Offset(-2, 0).Value = "YES" Then
If ActiveCell.Offset(-3, 0).Value = "YES" Then
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "NO"
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
Else
ActiveCell.Offset(0, -2).Value = "Count required?"
ActiveCell.Value = "YES"
End If
End If
Next i
Range("a1").Select
End Sub