+ Reply to Thread
Results 1 to 4 of 4

Lost spaces and Zeros lost when replacing text

  1. #1
    Registered User
    Join Date
    09-28-2013
    Location
    yorkshire ,england
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Lost spaces and Zeros lost when replacing text

    Hi

    This one has me confused

    When the data in the Cell is "xxxx: 05555" the result following the replace is "5555" where I would expect " 05555" , I would appreciate any Ideas to fix this;


    ActiveSheet.Columns("B").NumberFormat = "@"
    ActiveSheet.Columns("B").Replace What:="*:", Replacement:=""


    Thanks Kev ( using Excel 2003 )

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lost spaces and Zeros lost when replacing text

    You can simply go to Forma Cells, select Custom and type in 00000
    Or if you want to use use formula you can use this:

    =TEXT(A1,"00000")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Lost spaces and Zeros lost when replacing text

    Hi Renshawk
    Try this

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    09-28-2013
    Location
    yorkshire ,england
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Lost spaces and Zeros lost when replacing text

    Many thanks - this wont preserve the space and corrupts numbers of different length or format - e.g 05 and 55 are then changed - I realy need the Replace - to treat the cell as text.

+ 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. Leading Zeros lost in csv format
    By Scotsman89 in forum Excel General
    Replies: 18
    Last Post: 04-05-2012, 04:04 AM
  2. Lost Text!!!!!
    By Jacknife in forum Excel General
    Replies: 1
    Last Post: 03-24-2011, 05:48 AM
  3. [SOLVED] Replacing spaces with zeros
    By Oldjay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-16-2006, 09:10 AM
  4. Replies: 4
    Last Post: 01-26-2006, 05:20 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