My intention is for the code to pass through 9 TextBox checking if they are filled with names or empty.
For each filled TextBox would be added 1 in a count variable and would be allocated the text of the TextBox in another variable (p1, p2, p3 ..... p9).
The problem is: how to allocate the text in the variables p, considering the final number the same number as the count variable?
Ex:
Dim Cont As Integer
Dim P1, P2, P3, P4, P5, P6, P7, P8, P9 As String
If TextBox1.Text <> "" Then
Cont = Cont + 1
("P"&Cont) = TextBox1.Text <<< Essa parte que não sei escrever
End If
The intention at the end is to run a random number between 1 and the variable "cont" and randomly select 3 names registered in the variables P. That is, it would then be necessary to call the variables P by the number that was found by the random and register in some label, etc.