+ Reply to Thread
Results 1 to 6 of 6

special format from 1 cell

  1. #1
    Registered User
    Join Date
    03-23-2018
    Location
    belgium
    MS-Off Ver
    office 2016 plus
    Posts
    3

    special format from 1 cell

    Hello, i need some help to get a specific format starting from 1 cell

    for example cell A1 is:

    23001A22R9

    cell B1 needs to become:

    23001A0022/00R009

    bot for example cell A2 is:

    23001A222R99

    cell B2 needs to become:

    23001A0222/00R099

    So, there always needs to be 5 numbers followed by a letter followed by 4 numbers followed by / followed by 2 numbers followed by a letter followed by 3 numbers. And whe there is a missing number, it needs to be a 0

    thanks to anyone who will help me with this!!!!!!!!!!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: special format from 1 cell

    Will the 'A' and the 'R' always be there?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    03-23-2018
    Location
    belgium
    MS-Off Ver
    office 2016 plus
    Posts
    3

    Re: special format from 1 cell

    Hello,

    no, some data to help:

    23013A145Z9
    23013A148L
    23013A148N
    23013A148R
    23017D245W
    23017D257W2
    23027B80A11
    23027B80A12
    23027B80A13
    23027B80A14

    by the way, it can happen that there is no number after the last letter, like here: 23013A148L in this case, there still has to be 3 numbers at the end, so in this case it should be: 23013A0148/00L000
    Last edited by sinik; 03-23-2018 at 08:13 AM.

  4. #4
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: special format from 1 cell

    Try this UDF

    Use like a formula
    =RegexMatch(A1)

    Attached file has worked examples

    RegexForSinik.jpg

    .

    Code goes in standard module:
    Please Login or Register  to view this content.



    This is based on what you provided in post#1 as results

    If not what you want for items listed in post#3 then please list expected results for each item
    23013A145Z9
    23013A148L
    23013A148N
    23013A148R
    23017D245W
    23017D257W2
    23027B80A11
    23027B80A12
    23027B80A13
    23027B80A14
    Attached Files Attached Files
    Last edited by kev_; 03-23-2018 at 04:19 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  5. #5
    Registered User
    Join Date
    03-23-2018
    Location
    belgium
    MS-Off Ver
    office 2016 plus
    Posts
    3

    Re: special format from 1 cell

    thank you so much, that's perfect!!!!

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: special format from 1 cell

    Please click ThreadTools@TopOfThread to mark thread SOLVED
    Thanks for rep

+ 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. [SOLVED] Read a cell number and write it on a .txt within a special format
    By ropbasuel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2018, 11:31 AM
  2. Number cell format & special characters
    By underbooks in forum Excel General
    Replies: 1
    Last Post: 12-10-2015, 08:10 PM
  3. vba: getting certain cell in a new document in a special format
    By BROEA in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-27-2015, 09:29 AM
  4. Special format a cell
    By reno99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-14-2015, 08:33 AM
  5. [SOLVED] Addition to code to copy and pastes special values and cell format, but not links.
    By singerbatfink in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2014, 03:10 PM
  6. [SOLVED] Excel needs a special cell format for MAC addresses
    By Don in forum Excel General
    Replies: 0
    Last Post: 07-20-2006, 09:20 AM
  7. [SOLVED] Special format for feet - inches in a cell
    By Bothell John in forum Excel General
    Replies: 1
    Last Post: 09-07-2005, 09:05 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