Hi all
I need to compare string text using two different textbox. The user have to copy the source (text) first. After this the user have to type the text in the First textbox (this textbox disable pasting to prevent the copy text to be paste), after finished typing click the compare button at the user form. this will return the result by a messagebox whether it matched or not. this can be done using the Instr function but what I need was after the messagebox, it need to highlighted the result which text was not matched (the second textbox rather than the background colour change). thanks for the help and guidance in advance.
the code as follow:-
[pre]
[/pre]
I need to compare string text using two different textbox. The user have to copy the source (text) first. After this the user have to type the text in the First textbox (this textbox disable pasting to prevent the copy text to be paste), after finished typing click the compare button at the user form. this will return the result by a messagebox whether it matched or not. this can be done using the Instr function but what I need was after the messagebox, it need to highlighted the result which text was not matched (the second textbox rather than the background colour change). thanks for the help and guidance in advance.
the code as follow:-
[pre]
Code:
If InStr(1, txtverify.Text, txtmaker.Text, vbTextCompare) Then
MsgBox "Good and Perfect, all matched", vbInformation, "Well Done"
Else
MsgBox "Woops, NOT MATCH, REJECT and CHECK AGAIN", vbCritical, "ERROR"
txtverify.BackColor = vbRed
txtmaker.BackColor = vbRed
Beep
End If