Chewyhairball
Active Member
- Joined
- Nov 30, 2017
- Messages
- 312
- Office Version
- 365
- Platform
- Windows
I have the following bit of code that works fine with my user form combobox
I also have the following except it is for textbox2 and it doesnt work.
It relays the msgbox regardless if the values match or dont match and i cant figure out why.
The table range for 'InfoTable' is definately correct as it the col_index_num
it is driving me mad
Any ideas as to why the combobox would work but the textbox wouldnt?
Rory
VBA Code:
If ComboBox1.Value <> Application.WorksheetFunction.VLookup(Textbox3.Value, InfoTable, 6, False) Then
MsgBox "The selected value does not match " & textbox3.Value & " value previously input." & vbNewLine & vbNewLine & "Please recheck before inputing.", 64, "Value does not match"
Exit Sub
End If
I also have the following except it is for textbox2 and it doesnt work.
VBA Code:
If textbox2.Value <> Application.WorksheetFunction.VLookup(textbox3.Value, InfoTable, 2, False) Then
MsgBox "The selected value does not match " & textbox3.Value & " value previously input." & vbNewLine & vbNewLine & "Please recheck before inputing.", 64, "Value does not match"
Exit Sub
End If
It relays the msgbox regardless if the values match or dont match and i cant figure out why.
The table range for 'InfoTable' is definately correct as it the col_index_num
it is driving me mad

Any ideas as to why the combobox would work but the textbox wouldnt?
Rory