Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MULTIPLY CELLS IN ROWS CONTINUALLY ALY33 New Users to Excel 1 May 3rd 07 05:06 PM
Setting up a continually updating average KirbyCTB New Users to Excel 2 March 30th 07 12:30 AM
Continually check if condition is true in VBA [email protected] Excel Discussion (Misc queries) 1 October 4th 06 05:43 PM
Code Execution Continually Interrupted Peter Bernadyne Excel Discussion (Misc queries) 1 March 17th 06 04:07 PM
Average the last 5 of a continually filling row. Geo Excel Discussion (Misc queries) 12 January 6th 05 10:41 PM


All times are GMT +1. The time now is 04:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"