Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Variable Params for Recursion?

  Asked By: Lorraine    Date: Aug 18    Category: MS Office    Views: 5207
  

I'm getting too many iterations in RUNCELLVALUES, but
cannot track down the reason.

Anyone have an idea?

Sub RunTotalCount()
TotalCount = 0
RunCellValues 1, Min1, Max1, Step1, False
End Sub

Sub RunCombinations()
RunTotalCount
RunCellValues 1, Min1, Max1, Step1, True
End Sub

Sub RunCellValues(ByVal iIndex As Integer, Action)
If iIndex > SRange.Count Then Exit Sub
Dim ivalue As Integer
Dim Min, Max, S As Double
If iIndex <= SRange.Columns.Count Then
Min = Min1
Max = Max1
S = Step1
Else
Min = Min2
Max = Max2
S = Step2
End If
For ivalue = Min To Max Step S
If Action Then
SRange(iIndex).Value = ivalue
Else
TotalCount = TotalCount + 1
End If
RunCellValues iIndex + 1, Action
Next ivalue
End Sub

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Variable Params for Recursion? Or get search suggestion and latest updates.




Tagged: