View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
joecrabtree joecrabtree is offline
external usenet poster
 
Posts: 111
Default If JobNumber = Val(field(7)) Then Query

To all,

I have the following code:

If JobNumber = Val(field(7)) Then


It looks at field (7) which is typically a 5 digit number i.e. 36238

If JobNumber = 36238 then it will continue the script.

however in some cases the value in field (7) is 36238 OP1 or 36238/2
etc. How can I get it to search just the first 5 digits i.e 36238 of
the field (7) value, and enable the script to continue, rather than
returning nothing as it does at the moment?

Thanks in advance for your help,

regards

Joseph Crabtree