A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Is it possible to increment a Letter



 
 
Thread Tools Display Modes
  #1  
Old May 9th, 2004, 08:56 AM
Avir
external usenet poster
 
Posts: n/a
Default Is it possible to increment a Letter

Is it possible to increment a Letter A to B .....and so on till Z through code. Is there a function to increment it?

thanks for your help.

  #2  
Old May 9th, 2004, 11:00 AM
rkc
external usenet poster
 
Posts: n/a
Default Is it possible to increment a Letter


"Avir" wrote in message
...
Is it possible to increment a Letter A to B .....and so on till Z through

code. Is there a function to increment it?

thanks for your help.


How about Chr$(Asc(someLetter) +1) keeping in mind that A to Z = 65 to 90?


  #3  
Old May 10th, 2004, 04:57 AM
Byron
external usenet poster
 
Posts: n/a
Default Is it possible to increment a Letter

The following code will assign a starting Character (A)
to a string variable, then increment it to the next
character (B). Keep in mind that this is case sensative,
so what ever character you start with this will produce
the next character. You will need to check for the "Z =
90" and take appropriate action.

Dim strStartVal As String
Dim strNewVal As String
strStartVal = "A"
strNewVal = Chr(Asc(strStartVal) + 1)

HTH

Byron


-----Original Message-----
Is it possible to increment a Letter A to B .....and so

on till Z through code. Is there a function to increment
it?

thanks for your help.

.

  #4  
Old May 10th, 2004, 07:41 AM
Avir
external usenet poster
 
Posts: n/a
Default Is it possible to increment a Letter

Thanks Byron
It works great!
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:39 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.