LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can Step through but when run defines variable wrong

Hi, thanks for helping

When I step through the following code (lots of junk removed so it
should be easier to read) it works fine, however when I run it it works
fine until i = 527 then I get an error, and TimetoPM's value is wrong.
It comes out negative even when the formula makes it positive?

For i = 1 To LoopNumber Step 1
Ttotal = 0
Tevent = 0
WeightedAge = 0
y = 1
x = 0
Do
If WeightedAge = 0 Then
Tf = Alpha * ((WeightedAge / Alpha) ^ Beta - Log(1 - Rnd))
^ (1 / Beta) - WeightedAge
TimeToPM = (Period * y - Ttotal)
If Tf < TimeToPM Then 'If (Time to fail) < (Time of next
SM - Time of Last Event)
'stuff in here but no defining of TimetoPM
Else
'more stuff but TimetoPM is not changed
WeightedAge = WeightedAge + TimeToPM * (1 -
RestoreFactor)
End If
y = y + 1 'update SM multiple counter for System
Time option
End If
Ttotal = Tevent + Tm
Else
x = 1
End If
Loop While x = 0
Next

 
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
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
How show value of variable by mouse-over in debug single step mode Chet Shannon[_4_] Excel Programming 10 January 6th 06 03:31 PM
How show value of variable in single step debug mode? Chet Shannon[_4_] Excel Programming 2 November 28th 05 06:57 AM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 10:41 PM.

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

About Us

"It's about Microsoft Excel"