Hello
I have a number of textboxes (e.g. txtamount1, txtAmount2, txtAmount3...) from a userform which are to be filled from an array (arrInput) however I don't know how large the array is before hand so I need to check to see if the array has a value in it, if it does I populate the userform textbox with it and go on to the next location in the array.
I can acheive what I want using if statements...
    If arrInput(6, 5) <> "" Then
        txtAmount6.Value = arrInput(6, 5)
        cboFund6.Value = arrInput(6, 6)
    End If
    If arrInput(5, 5) <> "" Then
        txtAmount5.Value = arrInput(5, 5)
        cboFund5.Value = arrInput(5, 6)
    End if
...
I was wondering if I can do something like...
    Do
        cboFund&(D).Value = arrInput(D, 6)
        txtAmount&(D).Value = arrInput(D, 5)
    D = D - 1
    Loop Until D = 0
In the macro I'm making at the moment there are only 6 textboxes but I think this code would be useful for anything else I may try to write in the future.

Thanks for any input