Convert 1 Character Code to a word

D

Dave Peterson

He's that thing that will live on your couch and mooch off you, er, that's SON.

never mind!
 
D

Dave Peterson

First, you could use column C of that table worksheet. Then retrieve the value
from there.

(I'm guessing that you will use the same input codes.)

Option Explicit
Function myConversionA(rng As Range) As Long
'returns a whole number???
' As Double
'if you have fractions

Dim res As Variant
Dim LookUpTable As Range
Dim iCtr As Long
Dim myValue As Long

Set rng = rng(1)
Set LookUpTable = Worksheets("sheet2").Range("a:c")

myValue = 0
For iCtr = 1 To Len(rng.Value)
res = Application.VLookup(Mid(rng.Value, iCtr, 1), _
LookUpTable, 3, False)

If IsError(res) Then
'do nothing
Else
If IsNumeric(res) Then
myValue = myValue + res
End If
End If

Next iCtr

myConversionA = myValue

End Function
 
P

Pookie76

Dave said:
*He's that thing that will live on your couch and mooch off you, er
that's SON.

never mind!

Sorry about that. I didn't mean to seem like a mooch but I though
they were pretty similar codes and thought that what I had in min
would work. When it didn't, I asked for help again since the two code
aren't as similar as I thought it would be. It doesn't work right no
because the numbers are different but its getting there. I'll just hav
to play with it some more.

Also, i'm not a he. Thanks for all the help Dave
 
D

Dave Peterson

That comment wasn't meant for you. It was a (slight) joke between Debra and
me. She's a mother of a son and probably understands (you may understand your
own self).

And I (as a son) know precisely how to mooch and when to lay on the couch!

Sorry about the confusion.
 
P

Pookie76

Dave said:
*That comment wasn't meant for you. It was a (slight) joke betwee
Debra and
me. She's a mother of a son and probably understands (you ma
understand your
own self).

And I (as a son) know precisely how to mooch and when to lay on th
couch!

Sorry about the confusion.
[/email] *

Ohh, its all right. I know I am asking a lot and I'm still learning s
I like to ask a lot of questions early on. Thanks again Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top