calculate next in alphabet

G

Guest

How do I compute the next alphabetic character through code? I have a
variable (string) containing a single alpha letter (ie 'B') and i need to
determine the next alphabetic value (ie "C"). How can this be done?
 
A

Allen Browne

Use Asc() to get the ascii code of the character.
Add 1, and use Chr() to get the next character.

Example:
=Chr(Asc("B")+1)
 

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