+ Reply to Thread
Results 1 to 7 of 7

VBA problem - reverse an alphanumeric string, but reverse only letters and leave digits wh

  1. #1
    Registered User
    Join Date
    11-17-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    25

    VBA problem - reverse an alphanumeric string, but reverse only letters and leave digits wh

    Hi everyone,

    I have a VBA code puzzle to solve.

    I want to reverse an alphanumeric string, but reverse only letters and leave digits where they are.

    So for example:
    abc123dfg ---> gfd123cba
    451ubno98p ---> 451ponb98u
    egc88rtv972nq100 ---> qnv88trc972ge100

    Do you have any ideas?
    Probably I must use nested loop. I came with this idea, but it's not working perfectly:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    UDF

    Use in cell like

    =ReverseAlpha(A1)

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-17-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    25

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    Thank you! It's working fine

    I wonder if the same can be done using only nested loops in VBA.

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,911

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    Rory

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    Maybe :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  6. #6
    Registered User
    Join Date
    11-17-2017
    Location
    POLAND
    MS-Off Ver
    2013
    Posts
    25

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    Thank you!

  7. #7
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA problem - reverse an alphanumeric string, but reverse only letters and leave digit

    You are welcome, thanks for marking the thread as solved and rep.points.

    Regards

+ 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. Replies: 7
    Last Post: 11-27-2018, 08:02 PM
  2. Reverse Vlookup Partial String Match
    By Premmadaan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-22-2018, 08:38 PM
  3. [SOLVED] Reverse strings udf function to reverse numbers
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-07-2015, 07:03 AM
  4. Reverse Table Lookup using a partial string
    By pat3white in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-27-2013, 01:35 PM
  5. VBA code for extracting last three digits from alphanumeric string.
    By klantacook in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-01-2013, 05:30 PM
  6. [SOLVED] Combining letters and the last three digits of a number in reverse order
    By Closet Coder in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-21-2012, 08:40 AM
  7. How to remove digits from the end of an alphanumeric string?
    By Uz123 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2012, 09:16 PM

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