Need to break down the data into 3 different fields examples below

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Scan steel receiving - P063141049 682875 4480 There is a space between each
group of numbers. data length may be different so need to have the delimiter
in place to break correctly

First group of numbers will be the part number: P063141049 - need to drop
the p
Second group of numbers is the serial number: 682875
Third group of numbers will be the weight: 4480

Is there an easy way to do this.
 
Terry

Try This:

PartNumber = Mid(2,SteelReceiving,Instr(SteelReceiving," ")-2
SteelReceiving = MID(SteelReceiving, Instr(SteelReceiving, " ") +1)
SerialNumber = Left(SteelReceiving, Instr(SteelReceiving, " ")-1)
Weight = MID(SteelReceiving,Instr(SteelReceiving, " ")+1)

Kevin C
 
Scan steel receiving - P063141049 682875 4480 There is a space between each
group of numbers. data length may be different so need to have the delimiter
in place to break correctly

First group of numbers will be the part number: P063141049 - need to drop
the p
Second group of numbers is the serial number: 682875
Third group of numbers will be the weight: 4480

Is there an easy way to do this.

Yes, with a little bit of work with Instr() and Mid()...

The part number would be

Mid([Scan steel receiving], 2, InStr([Scan steel receiving], " ") -
1))

Serial number would be

Mid([Scan steel receiving], InStr([Scan steel receiving], " ") + 1,
InStr(InStr([Scan steel receiving], " ") + 1, [Scan Steel Receiving],
" ") - 1)

Weight would be

Mid([Scan steel receiving], InStrRev([Scan steel receiving], " ") + 1)

John W. Vinson[MVP]
 
Back
Top