为什么“喜欢”声明不起作用?
“=”语句检查为真,但“like”运算符检查为假,为什么?
Sub sandbox2()
Dim TagForm As String
TagForm = "tag(1###)<EX-->"
Debug.Print "Compare: " & Sheets(2).Cells(2, 2).Value & " To: " & TagForm
If Sheets(2).Cells(2, 2).Value = TagForm Then 'this works... displays message "Match!"
MsgBox "Match!"
End If
If Sheets(2).Cells(2, 2).Value Like TagForm Then 'this does not work... Does not display "Match!"
MsgBox "Match!"
End If
End Sub