String compare

slightly confused…can I do

if (“String1” <> “String2”) then ?

pl suggest

Subject: string compare

You can do

if “String1”<>“String2” then

End if

as “string1” is always not equal to “string2” so returns true and your code will always execute.

Subject: string compare

I don’t know if its exactly what you mean, but you can surely do:

Dim string1, string2 As String

string1="rice"

string2="bean"



If string1 <> string2 Then

	'different

	Msgbox "different"

Else

	'equal

	Msgbox "equal"

End If



'Or...



If "rice" <> "bean" Then

	'different

	Msgbox "different"

Else

	'equal

	Msgbox "equal"

End If