javajom
03-08-2008, 07:33 AM
--------------------------------------------------------------------------------
Hi,
Just a quicky, How do I compare 2 strings? I've just started in VBA and not quite use to the syntax. Here's the code I've done so far and works up to the point where it compares strings.
Public Function fShowMsg()
Dim Pass_Word As String
Dim sh As String
Pass_Word = "jon"
fShowMsg = MsgBox("Do you know the code?", vbYesNo)
If fShowMsg = vbYes Then
sh = InputBox("Enter the Password")
If Pass_Word = st Then
MsgBox ("Hello.")
End If
MsgBox ("Sorry that was incorrect, please contact creator.")
End If
End Function
It's only a rough function at the moment, so probably lots of errors.
Hi,
Just a quicky, How do I compare 2 strings? I've just started in VBA and not quite use to the syntax. Here's the code I've done so far and works up to the point where it compares strings.
Public Function fShowMsg()
Dim Pass_Word As String
Dim sh As String
Pass_Word = "jon"
fShowMsg = MsgBox("Do you know the code?", vbYesNo)
If fShowMsg = vbYes Then
sh = InputBox("Enter the Password")
If Pass_Word = st Then
MsgBox ("Hello.")
End If
MsgBox ("Sorry that was incorrect, please contact creator.")
End If
End Function
It's only a rough function at the moment, so probably lots of errors.