微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VBA 输入框显示

如何解决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 举报,一经查实,本站将立刻删除。