PDA

View Full Version : Solved: Problems with Input/message boxes



NeilM
12-28-2006, 02:44 PM
I am attempting to use the following code to return a message box with the message "correct" if the correct answer to a question is inputted into the input box. No matter whatI do "wrong" is returned.

Please help

Sub Test()
Inputbox ("Enter your answer here")
If RESPONSE = "1.44 MB" Then
MsgBox ("CORRECT!")
Else
MsgBox ("WRONG!!!")
End If
End Sub

Brandtrock
12-28-2006, 06:34 PM
Neil,

Welcome to VBAX!!!

Option Explicit
Dim response As String

Sub Test()
response = InputBox("Enter Your Answer Here:")
If response = "1.44 MB" Then
MsgBox ("CORRECT!")
Else
MsgBox ("WRONG!!!")
End If
End Sub

This is what should work.

Regards,

NeilM
12-29-2006, 04:14 PM
Thanks for your help Brandtrock, it is working fine now:hi:

Brandtrock
12-29-2006, 04:38 PM
You are welcome. :cool: