OK- I'm going to clarify this post a little bit because you're actually being helpful and my question was too vague. I have 280 workbooks of spreadsheets. On them, in column L I have (or am suppose to have) part numbers. The part numbers are 3EC15195, 3EC15200, 3EC16124, 3EC15240, 3EC15199, and 3EC15202. Now, a little bit tricky, the first 8 numbers of these part numbers determine a HECI code (I mistakenly said serial number, but it really doesn't make a difference)...I say first eight because the part numbers have date codes added to them. The first 8 numbers determine the HECI codes which are as follows in order VACTEHWBAA, VACTFKNBAA, VACTHNNBAA, VACTDG8BAA, BACEGR5DAA, and VACTG20BAA. The field reps who wrote down the codes generally got either the part number OR the HECI code, rarely both and occasionally neither, and I need both entered.
The following module worked perfectly when I used it along with =(LEFT(L7,8))as a function Function SelectType(CellRef
As String) As String
On Error GoTo Err_SelectType
Select Case CellRef
Case "3EC15195"
SelectType = "VACTEHWBAA"
Case "3EC15200"
SelectType = "VACTFKNBAA"
Case "3EC16124"
SelectType = "VACTHNNBAA"
Case "3EC15240"
SelectType = "VACTDG8BAA"
Case "3EC15199"
SelectType = "VACEGR5DAA"
Case "3EC15202"
SelectType = "VACTG20BAA"
Case Else
SelectType = "No reference"
End Select
Exit_SelectType:
Exit Function
Err_SelectType:
SelectType = "Data error"
Resume Exit_SelectType
End Function
The only problem was I had to put it in every worksheet and it didn't work the other way around (obviously), i.e, if I had the HECI it wouldn't give the part number. Another consideration is my project manager doesn't have a clue what a macro is and freaks out when he pulls up the spreadsheet and it gives the little message that macros are turned off because security level isn't high enough.
The following module worked perfectly when I used it along with =(LEFT(L7,8))as a function Function SelectType(CellRef
As String) As String
On Error GoTo Err_SelectType
Select Case CellRef
Case "3EC15195"
SelectType = "VACTEHWBAA"
Case "3EC15200"
SelectType = "VACTFKNBAA"
Case "3EC16124"
SelectType = "VACTHNNBAA"
Case "3EC15240"
SelectType = "VACTDG8BAA"
Case "3EC15199"
SelectType = "VACEGR5DAA"
Case "3EC15202"
SelectType = "VACTG20BAA"
Case Else
SelectType = "No reference"
End Select
Exit_SelectType:
Exit Function
Err_SelectType:
SelectType = "Data error"
Resume Exit_SelectType
End Function
The only problem was I had to put it in every worksheet and it didn't work the other way around (obviously), i.e, if I had the HECI it wouldn't give the part number. Another consideration is my project manager doesn't have a clue what a macro is and freaks out when he pulls up the spreadsheet and it gives the little message that macros are turned off because security level isn't high enough.