D
dan dungan
Hi programmers,
I've been tasked to build an application that will return a price when
the user enters a part number.
So, using Excel 2000 , I'm attempting to parse part numbers.
See the details below for more explanation.
Thanks,
Dan
I type a part number in cell A1:
Sub Test()
Dim Parts As String
'BAN stands for Basic Adapter Number
Dim BAN As Variant
Dim tBAN As String
Dim strBAN As String
Dim strVar1 As String
Dim strVar2 As String
Dim strVar3 As String
strVar1 = "217"
strVar2 = "265"
strVar3 = "266"
strBAN = strVar1 & "," & strVar2 & "," & strVar3
BAN = Split(strBAN, ",")
Parts = Range("A1").Value
tBAN = Mid(Parts, 1, 3)
If BAN = tBAN Then < run time error 13-type mismatch >
Range("B2").Value = BAN
End If
End Sub
____________________________________________________
Details:
Here are samples:
1 - 26515A06041056CZ
2 - 26615A06041056CZ
3 - 21715A06041056CZ
4 - E4101S08041N0551
5 - 901-704100356S
In the examples 1-3, I pull the core part price based on the basic
adapter number and connector code with a vlookup formula.
Basic Adapter Number
1 - 265
2 - 266
3 - 217
Connector Code
1-15
2-15
3-15
4. E4101S08041N0551
Example 4 doesn't have a basic adapter number. It has a
Function Designator = E
Connector Code=41
Series part number=01
5. 901-704100356S
Example 5 has doesn't have Basic Adapter number, Function Designator
or Series part number. It has a Basic Part Number
Basic Part Number = 901-704
I've been tasked to build an application that will return a price when
the user enters a part number.
So, using Excel 2000 , I'm attempting to parse part numbers.
See the details below for more explanation.
Thanks,
Dan
I type a part number in cell A1:
Sub Test()
Dim Parts As String
'BAN stands for Basic Adapter Number
Dim BAN As Variant
Dim tBAN As String
Dim strBAN As String
Dim strVar1 As String
Dim strVar2 As String
Dim strVar3 As String
strVar1 = "217"
strVar2 = "265"
strVar3 = "266"
strBAN = strVar1 & "," & strVar2 & "," & strVar3
BAN = Split(strBAN, ",")
Parts = Range("A1").Value
tBAN = Mid(Parts, 1, 3)
If BAN = tBAN Then < run time error 13-type mismatch >
Range("B2").Value = BAN
End If
End Sub
____________________________________________________
Details:
Here are samples:
1 - 26515A06041056CZ
2 - 26615A06041056CZ
3 - 21715A06041056CZ
4 - E4101S08041N0551
5 - 901-704100356S
In the examples 1-3, I pull the core part price based on the basic
adapter number and connector code with a vlookup formula.
Basic Adapter Number
1 - 265
2 - 266
3 - 217
Connector Code
1-15
2-15
3-15
4. E4101S08041N0551
Example 4 doesn't have a basic adapter number. It has a
Function Designator = E
Connector Code=41
Series part number=01
5. 901-704100356S
Example 5 has doesn't have Basic Adapter number, Function Designator
or Series part number. It has a Basic Part Number
Basic Part Number = 901-704