View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default If JobNumber = Val(field(7)) Then Query

How about the first 5 characters:

If JobNumber = Val(left(field(7),5) then

joecrabtree wrote:

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


--

Dave Peterson