Hi I need to run 5 reports for each account. Instead of running all 5 individually I want to run them through a Loop so run all on a click. I have a listbox on a userform that lists all the reports that need to be run. I have 4 text boxes to select certain columns in each row as it loops through. - the reports are based on what is in these text boxes.
The Listboxis called: lstPortfolioRDM
Userform is called: frmMenu
The Text-boxes on the Userform I want to auto fill in the Loop are
txtA- ListIndex, 4
txtB- ListIndex, 3
txtC - ListIndex, 2
txtD - ListIndex, 5
So basically, select the first record in the list, output certain column details into their allocated txtbox and then loop through the next.....and so on.
I'm new to looping. The below looks through the list but only picks out the top row each time.
Function Submit5()
Dim i, n As Integer
Dim selectedTextRDM As String
With frmMenu.lstPortfolioRDM
For n = 0 To .ListCount - 1
n = n + 1
i = frmMenu.lstPortfolioRDM.List(frmMenu.lstPortfolioRDM.ListIndex, 4)
frmMenu.txtA = ""
frmMenu.txtA = i
Next n
End With
End Function
Bookmarks