You're welcome.
Just to finish this, a UDF that does the same thing:
|
A |
B |
C |
D |
1 |
Hip |
4.61 |
HIP |
B1 and copied down and right: =PriceCodec(A1, "pathfinder") |
2 |
Fend |
59.78 |
FEND |
|
3 |
Panda |
127.82 |
PANDA |
|
4 |
Theft |
349.53 |
THEFT |
|
5 |
Inept |
679.13 |
INEPT |
|
6 |
Depth |
891.34 |
DEPTH |
|
7 |
Thrift |
3,406.53 |
THRIFT |
|
8 |
Fender |
5,978.90 |
FENDER |
|
9 |
Naptha |
7,213.42 |
NAPTHA |
|
10 |
Nipped |
7,611.98 |
NIPPED |
|
11 |
Pendent |
19,789.73 |
PENDENT |
|
12 |
Hardhat |
42,084.23 |
HARDHAT |
|
13 |
Narrated |
720,023.98 |
NARRATED |
|
14 |
Pathfinder |
12,345,678.90 |
PATHFINDER |
|
Function PriceCodec(ByVal sInp As String, ByVal sKey As String) As Variant
Dim i As Long
sKey = UCase(sKey)
If IsNumeric(sInp) Then
sInp = Replace(Format(sInp, "0.00"), ".", "")
For i = 1 To 10
sInp = Replace(sInp, i Mod 10, Mid(sKey, i, 1))
Next i
PriceCodec = sInp
Else
sInp = UCase(sInp)
For i = 1 To 10
sInp = Replace(sInp, Mid(sKey, i, 1), i Mod 10)
Next i
PriceCodec = CDbl(sInp) / 100
End If
End Function
Bookmarks