Consulting

Results 1 to 4 of 4

Thread: vba

  1. #1
    Banned VBAX Regular
    Joined
    Jul 2018
    Posts
    9
    Location

    vba

    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
    Else

    '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

  2. #2
    VBAX Regular
    Joined
    Jan 2018
    Location
    The Netherlands
    Posts
    45
    Location
    How can a code end with: Else

  3. #3
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    606
    Location
    .
    As Hightree said .... the code you posted is either incomplete (is there more code that you failed to post ?) .... or ... the code was simply someone "thinking out loud" but never finalized their project.

    The code you posted really doesn't do anything in it's present form.

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cross-posted at: http://www.msofficeforums.com/misc/39589-vba.html
    Please read VBA Express' policy on Cross-Posting in item 3 of the rules: http://www.vbaexpress.com/forum/faq...._new_faq_item3
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •