+ Reply to Thread
Results 1 to 6 of 6

Loop to next letter in Alphabet if condition met.

  1. #1
    Registered User
    Join Date
    01-21-2015
    Location
    California, USA
    MS-Off Ver
    2013
    Posts
    35

    Loop to next letter in Alphabet if condition met.

    Hello,

    I'm trying to do a project with a positioning system that is in a format that uses both letters and numbers to indicate position. Range of possible values shown in parentheses:

    (1-2):(A-F),(1-8)

    The very first position would be 1:A,1 and the very last position would be 2:F,8. If the position is 1:A,8 and we're trying to get to the next position, we would have to reset 8 to 1 and then increase A to B.

    I can loop through the numbers just fine since excel can do 1+1, but how do I get excel to move onto the next letter of the uppercase alphabet?

    Any help would be greatly appreciated!

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Loop to next letter in Alphabet if condition met.

    Theres probably a better way but I usually use the ASCII char set where A's value is 65, incrementing/ decrementing that value gives you the letter you want.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: Loop to next letter in Alphabet if condition met.

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    01-21-2015
    Location
    California, USA
    MS-Off Ver
    2013
    Posts
    35

    Re: Loop to next letter in Alphabet if condition met.

    Awesome, thanks you two!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,456

    Re: Loop to next letter in Alphabet if condition met.

    You're welcome. Thanks for the rep.

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Loop to next letter in Alphabet if condition met.

    Any time...

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Numbering using alphabet with few condition
    By knapp in forum Excel General
    Replies: 2
    Last Post: 10-21-2011, 07:37 PM
  2. Step through the alphabet with ForNext loop
    By jwright650 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2011, 02:21 PM
  3. Lets Remove the Letter F from our Alphabet
    By Mordred in forum The Water Cooler
    Replies: 16
    Last Post: 11-07-2010, 11:38 AM
  4. Replies: 5
    Last Post: 04-13-2010, 07:50 AM
  5. Replies: 7
    Last Post: 06-16-2008, 05:10 PM
  6. Randomly select from alphabet based on letter frequency distribution.
    By lemonstar in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-10-2008, 03:41 AM
  7. [SOLVED] check for alphabet in datalabel and then superscript that letter
    By Jyotsna in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2005, 05:05 PM
  8. Replies: 2
    Last Post: 07-26-2005, 03:05 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1