changing a number to a letter

D

dale atchison

i'm doing a price tag print out and want my wholesale cost
to be a letter instead of a number ex. 1.99 would be LEE
on my form i'm entering numbers but would like for the
cost code box to convert to letters

Thanks Dale
 
D

Duane Hookom

You can create a function:
Function MakeLetter(pdblVal As Double) As String
Dim strVal As String
Dim strLetters As String
Dim intPlace As Integer
strLetters = "JACKSONGHM"
strVal = Replace(Trim(Str(pdblVal)), ".", "")
For intPlace = 1 To Len(strVal)
strReturn = strReturn & _
Mid(strLetters, Val(Mid(strVal, intPlace, 1)) + 1, 1)
Next
MakeLetter = strReturn
End Function

Use this function where you want the letters:
=MakeLetter([Cost])
 

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