Want to put the name of all the students in one Textbox? As if it were a Combobox?
If you want a Combobox with the name of all students in a spreadsheet, do the following:
Go to the spreadsheet and select the columns, or rows (depending on how you are) that your students' names are and right-click. Click "Define Name". Define a name, for example "Student Listings".
In your Form, create a combobox (Combo box), change the name to cmbListaAlunos (or as you like, just for example here). Double-click the combo and edit this code:
Dim cLoc As Range
Dim ws As Worksheet
Set ws = Worksheets("NOME DA SUA PLANILHA")
For Each cLoc In ws.Range("O NOME QUE VOCÊ DEFINIU PARA A SELEÇÃO")
With Me.cmbListaAlunos
.AddItem cLoc.Value
End With
Next cLoc
This code will add all students of the spreadsheet in this combobox. To access another spreadsheet you need to activate it first. Sheets(WORKSHEET POSITION example: 1, 2 or 3). Activate.
Now, if with your system you want to show the students corresponding to a specific room, you can use this example to reflect. Because the code will be very complex to understand if it’s posted here.
If that answer wasn’t what you were looking for, just disregard.