Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Q: is this continually looping?
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 lThi**** 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 = "" lThi**** = 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 lThi**** = (lThi**** + 1) End If Next Next lHits(lThi****) = (lHits(lThi****) + 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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
is this continually looping?
Taking a quick look at it, it certainly looks to be looping. As I see it,
you are doing a loop based upon column A in row sRow being empty, but you don't seem to increment sRow anywhere. You should add 1 within the Do Loop -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "ste mac" wrote in message om... 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 lThi**** 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 = "" lThi**** = 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 lThi**** = (lThi**** + 1) End If Next Next lHits(lThi****) = (lHits(lThi****) + 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
is this continually looping?
Thanks Bob, l will have a look...
seeya ste "Bob Phillips" wrote in message ... Taking a quick look at it, it certainly looks to be looping. As I see it, you are doing a loop based upon column A in row sRow being empty, but you don't seem to increment sRow anywhere. You should add 1 within the Do Loop -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "ste mac" wrote in message om... 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 lThi**** 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 = "" lThi**** = 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 lThi**** = (lThi**** + 1) End If Next Next lHits(lThi****) = (lHits(lThi****) + 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MULTIPLY CELLS IN ROWS CONTINUALLY | New Users to Excel | |||
Setting up a continually updating average | New Users to Excel | |||
Continually check if condition is true in VBA | Excel Discussion (Misc queries) | |||
Code Execution Continually Interrupted | Excel Discussion (Misc queries) | |||
Average the last 5 of a continually filling row. | Excel Discussion (Misc queries) |