+ Reply to Thread
Results 1 to 8 of 8

Code to Replace Comma with dot and dot with comma

  1. #1
    Forum Contributor
    Join Date
    08-17-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    132

    Code to Replace Comma with dot and dot with comma

    Hi,

    Could somebody please help me to write a program to replace comma with dot and dot with comma in a number?

    For example, data is stored in a cell as 1.2345,36 in spreadsheet when the correct format is 1,2345.36.

    Please help to replace comma(,) with dot and dot with comma(,).

    Regards,

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Code to Replace Comma with dot and dot with comma

    You could try something like this in a helper column, copied down...
    =SUBSTITUTE(SUBSTITUTE(A1,".",""),",",".")*1

    Then, if necessary, copy/paste value from the helper to the original data, then delete the helper
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Re: Code to Replace Comma with dot and dot with comma

    Is that required for everything?
    Apart from FDibbins' solution, maybe this:
    Use the Data | Text to Columns... menu command. At Step 3 of 3 press the [Advanced...] button and set the Decimal separator to "," and the Thousands separater to "."

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Code to Replace Comma with dot and dot with comma

    ...stored in a cell as 1.2345,36 in spreadsheet when the correct format is 1,2345.36
    try
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Code to Replace Comma with dot and dot with comma

    Singh Sahab,
    lets try this...


    Please Login or Register  to view this content.
    Don't forget to click *
    Last edited by Vikas_Gautam; 07-17-2014 at 02:33 AM.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Code to Replace Comma with dot and dot with comma

    Another:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-17-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    132

    Re: Code to Replace Comma with dot and dot with comma

    All,

    You deserve Rep for the solution...

    Thanks,

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Code to Replace Comma with dot and dot with comma

    Happy to help and thanks for the feedback

+ 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] Code to replace comma with tab
    By momer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2013, 01:27 PM
  2. Find and remove all text to the left of last comma (including comma) in a cell
    By Excelrookie_1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2013, 08:47 AM
  3. [SOLVED] If comma present, then place a character before and after comma (FORMULA)
    By jaimealvarez in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-21-2012, 04:04 PM
  4. Replace comma on dot
    By makbos in forum Excel General
    Replies: 5
    Last Post: 08-16-2010, 05:09 AM
  5. replace the comma separator to a dot and dot to a comma at the same time
    By barkiny in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-24-2010, 05:42 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