+ Reply to Thread
Results 1 to 12 of 12

fill out shortened numbers

  1. #1
    Registered User
    Join Date
    02-12-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    4

    fill out shortened numbers

    Hi everyone,

    With apologies for cross-posting, posted also here: http://www.excelfox.com/forum/showth...e-page-numbers

    I need help with the following. I have a large set of page numbers, as below.

    Column A has the following shortened number format:
    A1: 3, 6-8, 24-56, 78, 123-45, 254-65
    A2: 55-6, 122-6, 156-68
    A3: 45, 255-8, 212-24
    and so on

    I need the following non shortened numbers in column B:
    B1: 3, 6-8, 24-56, 78, 123-145, 254-265
    B2: 55-56, 122-126, 156-168
    B3: 45, 255-258, 212-224

    Please note that sometimes the original shortening is to the last two digits (as in A1) and sometimes to the last digit (as in A2, A3), but in both cases I need output as in B1, B2, B3.

    Many thanks,
    Moshe
    Last edited by moblid; 02-12-2018 at 08:09 AM.

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: fill out shortened numbers

    Rule 08: Cross-posting Without Links

    Your post does not comply with Rule 8 of our Forum RULES. Do not cross-post your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    No further help to be offered, please, until the OP has complied with this request.
    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
    Registered User
    Join Date
    02-12-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    4

    Re: fill out shortened numbers

    ok, my apologies; indeed I posted elsewhere and did not think that it was a problem.
    many thanks for your help.

  4. #4
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: fill out shortened numbers

    You need to post links to everywhere else that you have asked the same question. Do that NOW, please. You will receive no help here until you have complied with the request, sorry.

    There is a link to the forum rules at the top of the page: you will need to read them before posting again. Thanks.

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

    Re: fill out shortened numbers

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    02-12-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    4

    Re: fill out shortened numbers

    Hi Jindon, this works great and was impressively fast! thanks very much!

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

    Re: fill out shortened numbers

    You are welcome and thanks for the rep.

  8. #8
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: fill out shortened numbers

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  9. #9
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,260

    Re: fill out shortened numbers

    Nice coding

  10. #10
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: fill out shortened numbers

    Quote Originally Posted by moblid View Post
    Hi Jindon, this works great...
    Are you sure it works as you need it to all of the time? What if you had this in a cell...

    45, 255-3, 212-24

    Jindon's code changes the red highlighted part to this...

    45, 255-253, 212-214

    whereas I would think you would want it to change to this instead...

    45, 255-263, 212-214

    Am I correct on what I think you would want for such a situation? If so, then what should the red highlighted part below become

    45, 255-34, 212-24

    I am thinking 334... would that be correct? If so, give this macro a try...
    Please Login or Register  to view this content.
    Note: The above code looks in Column A for its data and puts the output in Column B (that is what you explicitly asked for in Message #1)>
    Last edited by Rick Rothstein; 05-15-2018 at 02:22 AM.

  11. #11
    Registered User
    Join Date
    02-12-2018
    Location
    Israel
    MS-Off Ver
    2013
    Posts
    4

    Re: fill out shortened numbers

    Hi, thanks very much for your code. Actually I think what Jindon gave was good for me because my material does not shorten numbers in the way you describe; in case you wanted to 255-263 they would always write 255-63, and not 255-3.

  12. #12
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: fill out shortened numbers

    Quote Originally Posted by moblid View Post
    Hi, thanks very much for your code. Actually I think what Jindon gave was good for me because my material does not shorten numbers in the way you describe; in case you wanted to 255-263 they would always write 255-63, and not 255-3.
    Okay, so I am guessing that something like 294-312 would never be shortened to 294-12 then.
    Last edited by Rick Rothstein; 05-15-2018 at 04:39 AM.

+ 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. Can this code be shortened?
    By carlandtina02 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-12-2016, 06:14 AM
  2. Can this Formula be shortened
    By Toonies in forum Excel General
    Replies: 2
    Last Post: 12-14-2014, 07:51 AM
  3. Can this code be shortened?
    By zookeepertx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 09:52 AM
  4. Can this formula be shortened ?
    By Fantaxia in forum Excel General
    Replies: 12
    Last Post: 04-05-2014, 06:21 AM
  5. Can this formula be shortened?
    By zookeepertx in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-04-2014, 02:54 PM
  6. Can this Formula be shortened
    By IsoTech in forum Excel General
    Replies: 6
    Last Post: 08-04-2010, 04:04 AM
  7. [SOLVED] Can this Formula be Shortened Please
    By Paul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-03-2005, 06:06 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