Hello!
I have a problem. I am running an iteration macro within another iteration macro. The first iteration macro uses (or, is supposed to use) an ActiveX List Box to determine which items to loop through
(here, they are called "Sequences"). The second iteration macro loops through a date range.
My problem lies with the first macro. I want it to loop through a series of "Sequences" that are chosen by the user. However, every time I run my code, the iteration stops after only 1 iternation.
I.e., the only "Sequence" that the macro uses is the first one selected. The code is below"
Sub Iteration_Sequences()
On Error GoTo Errorcatch
Dim i As Long
With Sheets("Data Storage").ListBox_Sequences
For i = 0 To .ListCount
If .Selected(i) Then
Sheets("Data Storage").Range("C3").Value = i
Application.Run "Iteration_Dates"
End If
Next i
End With
Exit Sub
Errorcatch:
MsgBox Err.Description
Here is my code for the second iteration macro:
Sub Iteration_Dates()()
Sheets("Data Storage").Select
On Error GoTo Errorcatch
For i = Sheets("Data Storage").Range("D1").Value To Sheets("Data Storage").Range("D2").Value
Sheets("Data Storage").Range("D4").Value = i
Application.Run "Transfer"
Next i
Exit Sub
Errorcatch:
MsgBox Err.Description
End Sub
I know the code makes it all the way through both macros, because I have more code at the end of the "Iteration_Sequences" macro that is always executed at the end.
Any ideas?
Thanks!
Parker