+ Reply to Thread
Results 1 to 10 of 10

Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

  1. #1
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Hi,

    Need some help, might someone tell me a snipped to add to the code?

    Im trying to concatenate 5 cells from Range R22:V22 to Single cell DU22 but adding a dash between.

    The VBA code it does the job as long the string are single number with front zero, now i need to do the same but this time there are five cells and each one include 3 digits, Example : 000 001 010 121 110

    When are three positive digits is not a problem, but when such digits Include leading zero it wont concatenate correct.
    When I place the Formula - Concat(R22:V22) in Cell DU22 and DU23 as well, it won't display the leading zeroes at front or if the string is triple zero it just display single zero.

    Example:
    --->>>C O L U M N S
    ______R___S___T____U___V__
    Row
    22___010_000_010_112_212 -> DU22 ->Display --> 10-0-10-112-212
    23___000_120_100_120_121 -> DU23 ->Display --> 0-120-100-120-121

    This is the code I'm Using:

    Please Login or Register  to view this content.


    Thanks !!!

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Try this change

    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

  3. #3
    Forum Contributor
    Join Date
    01-03-2018
    Location
    Fukuoka, Japan
    MS-Off Ver
    Excel 2013
    Posts
    123

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    If you don't want front zeroes to vanish, you need to format the digits with Format function.

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Hi Crooza,

    No is displaying the same ...

    Example:
    --->>>C O L U M N S
    ______R___S___T____U___V__
    Row
    22___010_000_010_112_212 -> DU22 ->Display --> 10-0-10-112-212



  5. #5
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Hi Yujin,

    Is the same output my friend..

    Example:
    --->>>C O L U M N S
    ______R___S___T____U___V__
    Row
    22___010_000_010_112_212 -> DU22 ->Display --> 10-0-10-112-212



  6. #6
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Hi Jujin,

    Contrary, I need the Front zeros and or all zeros (if in cell contents)

    the first thing i did was the formatting 000-000-000-000-000

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Try this
    Please Login or Register  to view this content.

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    You may try something like this and see if that produces the desired output.

    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  9. #9
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Quote Originally Posted by AndyJr View Post
    Hi Crooza,

    No is displaying the same ...
    (
    Not on my example

    see attached
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    10-14-2017
    Location
    Miami, Florida
    MS-Off Ver
    2016
    Posts
    83

    Re: Concatenate 5 cells into a single But including front zeroes or all zeros, e.i 000

    Hi,

    Yes is working!!

    the Call function was ConCatAll=

    Excel cell had ConCatal (from previous code tested)

    Thank you all !!

    Crooza, Yujin, Jolivanes and sktneer !!

    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. [SOLVED] Concatenate not including all Zeros in 4digit custom format
    By DoraExplorExcel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-17-2017, 01:32 PM
  2. [SOLVED] Averages of nonconsecutive cells including zeros.
    By per11 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-23-2016, 02:39 PM
  3. Replies: 6
    Last Post: 03-17-2016, 12:52 PM
  4. calculating average in cells, not including zeros
    By kingy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2014, 03:00 AM
  5. [SOLVED] Adding a specified amount of zeroes in front of a number
    By ShareTheGlobe in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-31-2014, 06:20 AM
  6. Replies: 5
    Last Post: 04-09-2012, 02:28 PM
  7. [SOLVED] insert zeros in front of cells already filled with data.
    By Horizon in forum Excel General
    Replies: 2
    Last Post: 01-16-2006, 04:47 PM

Tags for this Thread

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