PDA

View Full Version : wordvba



phoenixmoto
07-15-2018, 07:17 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 commandbitton1_click()
Form1.Cls
addName
End sub

Private sub commandbitton2_click()
End
End sub

'In this code what is form1 or form1.Cls I found this code in pdf this code creates dialog box with start(commandbitton1)and exit(commandbutton2) buttons in userform according to me but I don't know actually where to insert this code or its part in module1 or class module or userform . Please.....help

macropod
07-15-2018, 03:35 PM
This thread is a duplicate of http://www.vbaexpress.com/forum/showthread.php?63158-vba
Kindly don't post the same topic multiple times. Thread closed. You may continue the discussion in your original thread.