Posted on 2006-11-09
Hello, I'm trying to validate values in spreadsheet cells before they are imported in a database.
I'm using this function to make sure this field is either a "P" or "B". I need this to NOT be case sensitive. In other words I want to validate this value is either P,p,B, or b and this InStr function is looking for literal string...upper-case in this example and will error if it finds "p" or "b".
Here's the function:
If InStr("P|B", Range("Buy_Pick").Cells(current_row)) = 0 Then
result = result & "Invalid pick - buy value." & vbLf