DA Master
03-15-04, 08:22 AM
Private Sub cmdEnter_Click()
' Dimension Our Variables
Dim strGroup1 As String
Dim strGroup2 As String
Dim strGroup3 As String
Dim strGroup4 As String
Dim strGroup5 As String
Dim strIsCorrect As String
' Populate Variables
Do While strIsCorrect <> "Yes"
For i = 1 To 5
strGroup = InputBox("Enter your number most favourite group", "Group")
Next i
' Print Variable Results
Print "Thank you for entering your 5 most favourite"
Print "groups which are as follows:-"
Print strGroup
strIsCorrect = InputBox("Is this correct?", "List Correct?")
If strIsCorrect = "Yes" Then
MsgBox "Thank You", vbInformation, "Thank You"
End
End If
Loop
End Sub
I have this code, that brings up five input boxes and allows the user to input their five favoruite groups. However, I cannot figure out how to assign strGroup[Number] (Dimensioned at top) into this line of code...
strGroup = InputBox("Enter your number most favourite group", "Group")
Which is in a For Next loop to save writing out the code over again.
Any help is greatly appriciated.
' Dimension Our Variables
Dim strGroup1 As String
Dim strGroup2 As String
Dim strGroup3 As String
Dim strGroup4 As String
Dim strGroup5 As String
Dim strIsCorrect As String
' Populate Variables
Do While strIsCorrect <> "Yes"
For i = 1 To 5
strGroup = InputBox("Enter your number most favourite group", "Group")
Next i
' Print Variable Results
Print "Thank you for entering your 5 most favourite"
Print "groups which are as follows:-"
Print strGroup
strIsCorrect = InputBox("Is this correct?", "List Correct?")
If strIsCorrect = "Yes" Then
MsgBox "Thank You", vbInformation, "Thank You"
End
End If
Loop
End Sub
I have this code, that brings up five input boxes and allows the user to input their five favoruite groups. However, I cannot figure out how to assign strGroup[Number] (Dimensioned at top) into this line of code...
strGroup = InputBox("Enter your number most favourite group", "Group")
Which is in a For Next loop to save writing out the code over again.
Any help is greatly appriciated.