Need a function that takes an alpha-numeric character (i.e. A or B or C or # or &) and returns the Chr() value

Posted on 2005-03-16
Medium Priority
Last Modified: 2010-05-02
I need a simple function like this:

Public Function GetChrValue(SingleCharacter as string) as Long

             Dim Char as string, CharLong as Long

             Char = Left(SingleCharacter, 1)     ' For those people who don't understand the word "Single"

             CharLong = '[ HERE'S WHAT I NEED ]

             GetChrValue = CharLong

End Function


Question by:timothyspriggs
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 96

Expert Comment

by:Lee W, MVP
ID: 13553286
Sorry, I'm a bit confused...  You need the function you posted...?
LVL 10

Accepted Solution

ADSaunders earned 2000 total points
ID: 13553298
You need the ASCII value of the character as a long??
CharLong = clng(ASC(Char))

.. Alan

Author Comment

ID: 13553507
Ahhh.... Alan gets it. Thanks.

Author Comment

ID: 13553519
Leew, read the function... see where it says [ HERE'S WHAT I NEED ]? That's what I needed.

I know it was simple, but I just had a brain fart and couldn't remember how to do it -- like forgetting a girls name -- haha.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question