VBA 输入框显示

问题描述

我真的不知道是否有人能理解。但是我想要做的是...我想在输入框中存储两个或多个值,因此当用户输入任何数据时,它会给出我存储的响应,但如果没有,它将给出诸如“我目前无法真正检测到您的学校”之类的回复,如下面的代码所示

Sub MessageBox_shortSurvey()
Dim name As Variant
Dim welcome As Variant
Dim department As Variant
Dim iwe As Variant
Dim Level As Integer
Output = MsgBox("Hello! I'm Fortunate's Personal Assistant Bot" & vbNewLine & vbNewLine & "Are You Interested In Taking A Short Survey With Me?",vbYesNo + vbQuestion,"Short Survey")
If Output = vbYes Then
    MsgBox "Great! I'll Guide You Through This"
    name = InputBox("First Question,What's Your Name?")
    If name <> "" Then
        welcome= MsgBox("                     Welcome " & name & vbNewLine & vbNewLine & " Would you like to continue with the survey?",vbYesNo)
            If Continue = vbYes Then
                Level = InputBox("What Level Are You Currently?")
                MsgBox "Nice One!"
                department = InputBox("What department?")
                iwe = MsgBox("Wow! That's nice,you must be an iwe!",vbYesNo)
                If iwe = vbYes Then
                    one = MsgBox("You have one more question to go,continue?",vbYesNo)
                    If one = vbYes Then
                        school = InputBox("Which state is your school located?")
                        MsgBox "Thank You,I've taken note of all your information"
                        result = MsgBox("Do You Want To View Result Now?",vbYesNo)
                        If result = vbYes Then
                            MsgBox "Inna Moment..."
                            MsgBox "This is a bio of you,based on my intelligence and your info supplied"
                            MsgBox "Your Name is " & name
                            MsgBox "You're in " & Level & " level," & " a Student of " & department & " Department"
                            If school = "Ondo" & school = "Lagos" Then
                            'just before this,I'm trying to pick from any two values that are typed in the textBox,'such that when user inputs from any two stored values the system will return a given response
                                MsgBox "From the look of things,you must be from FUTA,The Federal University of Technology,Akure"
                            Else
                            MsgBox "I can't really detect your school at the moment"
                            End If
                        Else
                            MsgBox "Thank You For All Your information,I'm Always Here For You,Goodbye!"
                        End If
                    Else
                        MsgBox "Thank you for holding on,You Can Always Try Again"
                    End If
                Else
                MsgBox "Thanks for participating"
                End If
            End If
        Else
    End If
    Else
        MsgBox "Thanks! But you can try again if you change your mind"
End If
End Sub

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)