S
ste mac
Many thanks for taking the time to have a look at my problem.
The code below does what its supposed to do in a nansecond
The problem is, after it has produced the answer it carries
on running, is it continually looping?
I was hoping one of you guys can see what i have done wrong
or offer a better solution... cheers..
seeya ste
Public sSheetOne As String
Public hRow As Long
Public hCol As Long
Public sRow As Long
Public sCol As Long
Public lHits(5) As Long
Public lThishit As Long
Public lx As Long
Public Sub HistoryCheck()
sSheetOne = "Data Control"
sRow = 2
Do While Not Sheets(sSheetOne).Cells(sRow, 1).Value = ""
CheckThisData
UpdateTotals
Loop
End Sub
---------------------------------------
Private Sub CheckThisData()
For lx = 0 To 5
lHits(lx) = 0
Next
hRow = 2
Do While Not Sheets(sSheetOne).Cells(hRow, 1).Value = ""
lThishit = 0
For hCol = 2 To 6
For sCol = 9 To 13
If (Sheets(sSheetOne).Cells(hRow, hCol).Value =
Sheets(sSheetOne).Cells(sRow, sCol).Value) Then
lThishit = (lThishit + 1)
End If
Next
Next
lHits(lThishit) = (lHits(lThishit) + 1)
hRow = (hRow + 1)
Loop
End Sub
--------------------------------------
Private Sub UpdateTotals()
For lx = 0 To 5
Sheets(sSheetOne).Cells(sRow, (14 + lx)).Value = lHits(lx)
Next
End Sub
The code below does what its supposed to do in a nansecond
The problem is, after it has produced the answer it carries
on running, is it continually looping?
I was hoping one of you guys can see what i have done wrong
or offer a better solution... cheers..
seeya ste
Public sSheetOne As String
Public hRow As Long
Public hCol As Long
Public sRow As Long
Public sCol As Long
Public lHits(5) As Long
Public lThishit As Long
Public lx As Long
Public Sub HistoryCheck()
sSheetOne = "Data Control"
sRow = 2
Do While Not Sheets(sSheetOne).Cells(sRow, 1).Value = ""
CheckThisData
UpdateTotals
Loop
End Sub
---------------------------------------
Private Sub CheckThisData()
For lx = 0 To 5
lHits(lx) = 0
Next
hRow = 2
Do While Not Sheets(sSheetOne).Cells(hRow, 1).Value = ""
lThishit = 0
For hCol = 2 To 6
For sCol = 9 To 13
If (Sheets(sSheetOne).Cells(hRow, hCol).Value =
Sheets(sSheetOne).Cells(sRow, sCol).Value) Then
lThishit = (lThishit + 1)
End If
Next
Next
lHits(lThishit) = (lHits(lThishit) + 1)
hRow = (hRow + 1)
Loop
End Sub
--------------------------------------
Private Sub UpdateTotals()
For lx = 0 To 5
Sheets(sSheetOne).Cells(sRow, (14 + lx)).Value = lHits(lx)
Next
End Sub