Do...Loop not working

S

Sunny Lin

I'm frustrated! My code is so simple, but for some reason (which I know
I missed) is not running. It's a simple Do...Loop Until statement.
Inside the loop are just if...then conditionals. However, when I run
it, I get an error stating that there is a loop without a do. Here is a
part of the code:

Do
If Me.Cells((i - c) + j, 3) = 3 Then
If (DateDiff("n", date1, date2)) / 60 > 0.3
Then
cumtime = cumtime + (DateDiff("n", date1, date2)) / 60
End
End
j = j + 1
Loop Until DateDiff("d", date1, date2) >= 1

Looks pretty straightforward to me. Why am I getting the error
message?? Any help would be greatly appreciated. Thanks.

Sunny
 
K

keepITcool

s/b

IF
...
end IF

instead of

if
...
end


end by itself is something entirely different..



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Sunny Lin wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top