jasonb75
Well-known Member
- Joined
- Dec 30, 2008
- Messages
- 15,507
- Office Version
- 365
- Platform
- Windows
Hi all,
Can somebody please put me right before I go insane, I know this should be simple but I've only used match functions in VBA a couple of times and I can't get the syntax to work right.
I need to look for an exact match for the textbox entry, first in row 3, then in row 1, with a message if no match found.
Thanks in advance.
Can somebody please put me right before I go insane, I know this should be simple but I've only used match functions in VBA a couple of times and I can't get the syntax to work right.
I need to look for an exact match for the textbox entry, first in row 3, then in row 1, with a message if no match found.
Code:
On Error GoTo line2
a = Application.Match(Edit1.TextBox1.Value, Sheets("Data_Sheet").Range("A3:CU3"), 0)
GoTo Line4
line2:
On Error GoTo line3
a = Application.Match(Edit1.TextBox1.Value, Sheets("Data_Sheet").Range("A1:CU1"), 0)
GoTo Line4
line3:
MsgBox Edit1.TextBox1.Value & " Not Found, Please chack and try again.", vbInformation & vbOKOnly
Line4:
Thanks in advance.