bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Macros > Determining an ANSI Value in a Macro

Determining an ANSI Value in a Macro

Summary: If you need to know the character code of a particular character, you can use the Asc function. This tip shows you how. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

You can use the Asc function to determine the ANSI value of the first letter of a string. In early versions of BASIC, Asc returned the ASCII value, but Excel uses only ANSI values. The function uses the following format:

x = Asc(y)

where x is the variable that the ANSI value should be assigned to, and y is the string to be analyzed. The way in which the Asc function works is very similar to the CODE worksheet function.

Tip #2527 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007


Save Time! You can have this tip (and several hundred just like it) in the ExcelTips annual archives. Imagine having over 400 tips available at your fingertips, in each annual volume.

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home
Vital News Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)