+ Reply to Thread
Results 1 to 4 of 4

If result contains a letter, paste to a different cell

  1. #1
    Registered User
    Join Date
    03-23-2019
    Location
    Vancouver, BC
    MS-Off Ver
    2016
    Posts
    2

    If result contains a letter, paste to a different cell

    Hi All. So I have written some code that will split up the characters in a cell and paste them in adjacent cells. The last characters it pastes are some numbers. Sometimes though this number will contain one letter (from A-Z) at the end it. If this is the case I would like that letter to get pasted in the next cell adjacent to where the number will end up. Any thoughts would be appreciated.

    I have the code working to do this:
    82XX-103A Will get split up 82>X>X>103A (using ">" to illustrate next adjacent cell)
    82XXX-103A Will get split up 82>X>X>X>103A
    82XXXX-103A Will get split up 82>X>X>XX>103A

    I would rather:
    82XX-103A Will get split up 82>X>X>103>A
    82XXX-103A Will get split up 82>X>X>X>103>A
    82XXXX-103A Will get split up 82>X>X>XX>103>A

    Working Code (I suspect their may be some unnecessary things it took a bit to get this far):



    Please Login or Register  to view this content.
    Last edited by AliGW; 03-23-2019 at 01:52 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,511

    Re: If result contains a letter, paste to a different cell

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done it for you this time.)


    Administrative Note:

    We would very much like to help you with your query, however you need to include code tags around your code.

    Please take a moment to add the tags. Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, and it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (Note: this change is not optional. As you are new here, I have done it for you this time.)


    Our forum rules (please read): https://www.excelforum.com/forum-rul...rum-rules.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: If result contains a letter, paste to a different cell

    This code assumes that your sata is in column A starting at A1.

    Please Login or Register  to view this content.
    Last edited by mehmetcik; 03-24-2019 at 06:48 AM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    03-23-2019
    Location
    Vancouver, BC
    MS-Off Ver
    2016
    Posts
    2

    Re: If result contains a letter, paste to a different cell

    Thanks for the replies guys, I gave them a try but they did not seem to do anything.

+ 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: 8
    Last Post: 02-12-2020, 02:47 AM
  2. Learning
    By ShashiSuppi in forum The Water Cooler
    Replies: 2
    Last Post: 08-01-2017, 05:54 AM
  3. Learning
    By ShashiSuppi in forum Suggestions for Improvement
    Replies: 1
    Last Post: 07-31-2017, 03:32 AM
  4. Hi All Just learning here.
    By Windyz in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-01-2016, 01:38 AM
  5. VBA code advice/Excel advice for summing groups of numbers
    By paulblower in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-17-2014, 05:47 AM
  6. Tips/Advice for Learning VBA
    By amartino44 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-28-2012, 04:37 PM
  7. Learning VBA - Suggestion for Beginners Learning Curve
    By sighlent1 in forum Excel General
    Replies: 1
    Last Post: 08-26-2010, 12:58 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