zulfahmi
12-05-2018, 01:19 AM
Dim studentName(10) As String
Dim num As Integer
Private Sub addName()
For num = 1 To 10
studentName(num) = InputBox("Enter the student name", "Enter Name", "", 1500, 4500)
If studentName(num) <> "" Then
Form1.Print studentName(num)
Else
End
End If
Next
End Sub
Private Sub Exit_Click()
End
End Sub
Private Sub Start_Click()
Form1.Cls
addName
End Sub
Here in this code what does "Form1.cls" mean,whether it is userform or module or classmodule.what does ".cls" mean.I found this code in one of vba pdf online.If i paste this code in userform1 and run this code (start_click) userform1 shows up and when i press start it delivers run time error 424 object recquired error message.Please help.
Dim num As Integer
Private Sub addName()
For num = 1 To 10
studentName(num) = InputBox("Enter the student name", "Enter Name", "", 1500, 4500)
If studentName(num) <> "" Then
Form1.Print studentName(num)
Else
End
End If
Next
End Sub
Private Sub Exit_Click()
End
End Sub
Private Sub Start_Click()
Form1.Cls
addName
End Sub
Here in this code what does "Form1.cls" mean,whether it is userform or module or classmodule.what does ".cls" mean.I found this code in one of vba pdf online.If i paste this code in userform1 and run this code (start_click) userform1 shows up and when i press start it delivers run time error 424 object recquired error message.Please help.