Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    20

    Unanswered: increment letters

    anyone know how to increment letters on a form or in code?
    eg A to B

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    use the chr$(<charactercode>) function, however you need to know your ANSI codes and 26 times table

    "A" equates to CHR$(65)
    "B" equates to CHR$(66)

    therefore
    Code:
    for intLoop=65 to 91
      debug.print intLoop & " equates to:" & chr$(34) & Chr$(intLoop) & chr$(34)
    next intloop
    shoudl print out
    65 equates to "A"
    66 equates to "B"
    .......
    91 equates to "Z"
    There is an associated function ASC which retirns the ANSI code of the specified character
    eg
    ASC("A") returns 65
    HTH

  3. #3
    Join Date
    Jan 2005
    Posts
    20
    Thanks a lot!
    Got it sorted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •