Monday 6 April 2015

VBA string comparison example using strcomp

Sub StringComp()
Dim name As String
Dim name1 As String

name = "abc" ' Change string here
name1 = "ab" ' Change string here
If (StrComp(name, name1) = 1) Then
MsgBox ("Not Matched")
Else
MsgBox ("Matched")

End If
End Sub

No comments:

Post a Comment