Hi there,
I want to check a cell. If it doesn't meet one of the patterns below, it will return error msgbox.
1. Start with "OP" and the length is 8, or
2. Start with "DF" and the length is 10
I wrote a code like this:
However, it doesn't work. Could you please point out why?![]()
If Not (Left(cell.value, 2)) = "OP" And Len(cell.value) = 8) Or _ ((Left(cell.value, 2)) = "DF" And Len(cell.value) = 10) then msgbox "Error" End if
Thank you so much,
Harry
Bookmarks