I have a Spreadsheet for writing school reports, there are a number of subjects e.g. Maths and English. I have a userform that lists pupils names, as I need the same names for each subject I have set up a module that will copy the names from a sheet to the labels, and my code is:
I have tried to call it in my Userform with the following code:
But when I run it, it says 'Run-time error 424 Object required. Where am I going wrong?
VBA Code:
Sub Names()
LblName1.Caption = Sheets("Data").Range("B2").Value
LblName2.Caption = Sheets("Data").Range("B3").Value
End Sub
I have tried to call it in my Userform with the following code:
VBA Code:
Private Sub Userform_Initialize()
Call Module1.Names
End Sub
But when I run it, it says 'Run-time error 424 Object required. Where am I going wrong?