2
My intention is that the code goes through 9 Textbox checking if they are filled with names or empty.
For each Textbox filled would be added 1 in a counting 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 of the counting 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 rotate a random number between 1 and the variable "cont" and randomly select 3 names registered in the variables P. That is, then it would be necessary to call the variables P by the number that was found by the random and register in some label, etc.
Why don’t you create a array with these names and then search the indexes randomly?
– Jéf Bueno