+ Reply to Thread
Results 1 to 7 of 7

Cell containing comma delimited string changes to number format issue

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,331

    Cell containing comma delimited string changes to number format issue

    Hi All

    Am trying to assist with following thread...Please see attached file...Somehow during the code run, the populated cell's number format changes from General to number...Has me baffled...Any ideas?...Perhaps an even better solution so i too can learn lol.
    https://www.excelforum.com/excel-pro...s-numbers.html
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Cell containing comma delimited string changes to number format issue

    Is there any reason the number format is not changed at runtime?
    Teach me Excel VBA

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,331

    Re: Cell containing comma delimited string changes to number format issue

    Hi ImranBhatti

    Have tried code enforcing column to General format but no avail...gets overwritten

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Cell containing comma delimited string changes to number format issue

    If your code enters say 123,456 that would be interpreted as 123456 and given a comma style formatting. Format the cell as Text first (numberformat = "@") or prefix the value with an apostrophe.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,331

    Re: Cell containing comma delimited string changes to number format issue

    Oh my hat...xlnitwit.

    That worked... please explain in more detail
    Please Login or Register  to view this content.
    Edit 1...Suppose i could have just done this...
    Edit 2...NOPE IT DOESN'T
    Please Login or Register  to view this content.
    Last edited by sintek; 02-20-2018 at 03:45 AM.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Cell containing comma delimited string changes to number format issue

    Setting the cell's number format to Text stops Excel from trying to interpret the value as it is entered.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,331

    Re: Cell containing comma delimited string changes to number format issue

    Got it, thanks again...

+ 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] Simplification for regex code to replace numbers in a comma delimited string
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2018, 06:30 AM
  2. Replies: 1
    Last Post: 02-02-2017, 06:05 PM
  3. [SOLVED] Summing Values Based on a Comma Delimited String
    By bryan0 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2013, 11:43 AM
  4. Excel 2007 : Pivot Table String Comma Delimited
    By asyssovers in forum Excel General
    Replies: 0
    Last Post: 06-08-2011, 01:23 AM
  5. Building a comma delimited string from Cell Range
    By Patchworks in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 11-17-2008, 12:25 AM
  6. Searching a comma delimited string in a cell
    By migpics in forum Excel General
    Replies: 7
    Last Post: 11-26-2007, 05:58 PM
  7. [SOLVED] How do I save format changes in a comma delimited file?
    By mariam0673 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-01-2005, 02:06 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