This page is going to show you a very simple and easy way to be able to pass an array of controls to a function or subroutine.
1 2 3 4 5 6 7 |
Sub ClearTextBoxControlArray(TextBoxArray As Variant) Dim i As Integer: For i = TextBoxArray.lbound To TextBoxArray.ubound 'assuming you want to clear all the textboxes in the array TextBoxArray(i).Text = "" Next i End Sub |
To use:
lets say you have an array