Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting Loops
Hello. I'd like to count how many times particular parts of a loop peform. (At least I think that's what I want.) So I have: Do Until ActiveCell.Value = "" If ActiveCell.Value < 0 Then ActiveCell.Cut ActiveCell.Offset(0, 56) ActiveCell.Offset(0, 1).Activate Else ActiveCell.Offset(0, 1).Activate End If Loop and I'd like to know how many times the first instructions are performed, and how many times the second part of the statement is performed. Hope that makes sense. Thanks. Dan *** Sent via Developersdex http://www.developersdex.com *** |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Counting Loops
Do Until ActiveCell.Value = ""
nTotal = nTotal + 1 If cell.Value < 0 Then nFirst = nFirst + 1 ActiveCell.Cut ActiveCell.Offset(0, 56) ActiveCell.Offset(0, 1).Activate Else ActiveCell.Offset(0, 1).Activate End If Loop Msgbox "Total: " & nTotal & vbnewline & _ "First: " & nFirst -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "Dan G." wrote in message ... Hello. I'd like to count how many times particular parts of a loop peform. (At least I think that's what I want.) So I have: Do Until ActiveCell.Value = "" If ActiveCell.Value < 0 Then ActiveCell.Cut ActiveCell.Offset(0, 56) ActiveCell.Offset(0, 1).Activate Else ActiveCell.Offset(0, 1).Activate End If Loop and I'd like to know how many times the first instructions are performed, and how many times the second part of the statement is performed. Hope that makes sense. Thanks. Dan *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
counting and loops | Excel Programming | |||
loops ... | Excel Programming | |||
Do loops within Do loops | Excel Programming | |||
Do Loops | Excel Programming | |||
LOOPS | Excel Programming |