+ Reply to Thread
Results 1 to 19 of 19

Remove comma from column in working code.

  1. #1
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Remove comma from column in working code.

    HI I have this code and it works fine. I need it to be moderated so it remove the comma.

    But important is that it keep all digits in the number.
    Example 0,73 can be 73 thats good
    1,141.37 shall be 114137

    10,746.00 shall be 1074600 (important that it keep the 2 digit after, where the normall will be a comma or . for the decimal )

    430,556.86 shall be 43055686

    Here is my code. It normal change from text to number with comma as decimal.

    There is also a sample sheet to play with. With a command button in sheet 1

    Please have a look

    Sincerely

    Abjac

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Remove comma from column in working code.

    This recorded macro will do that for you.

    Please Login or Register  to view this content.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    HI Oeldere. And thanks for your answer.
    I need the code to start after the header. So if the range can be from example J1 it will be good.
    Sorry did not put a header in below sample. I also need it to keep the zeroes after the decimal before. I need this because i need to paste these numbers in another application, where i need also the zeroes. See example below. It cut off the zeroes in some of the numbers.
    Column is not changed ony column J. Try to compare or also maybe try this in the sample.

    Please have a look thanks

    1,000.00 should be 100000
    1,011.60 should be 101160

    Sincerely

    Abjac

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Remove comma from column in working code.

    Abjac,
    You could use CTRL+H, type "," and replace with hit the button space and replace all. The is same as recorded macro

  5. #5
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    Hi AB33 Thanks could that be put into a macro? tried what you said it did not work. Dont know if i do it correctly. I use excel 2003, dont know if that make a change
    Last edited by abjac; 02-09-2013 at 04:05 PM.

  6. #6
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Remove comma from column in working code.

    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Remove comma from column in working code.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    Hi AB33 I make it work, but it cut also the zeroes

    Please have a look below thanks

    Please Login or Register  to view this content.
    I use this code only for column H

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Remove comma from column in working code.

    hi abjac, option, please check attachment, press Run button
    Attached Files Attached Files

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Remove comma from column in working code.

    Hi Abjac,

    Is that my code?? Here's a new version:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  11. #11
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Remove comma from column in working code.

    Please Login or Register  to view this content.

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

    Re: Remove comma from column in working code.

    This should do it.
    Please Login or Register  to view this content.

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Remove comma from column in working code.

    hi abjac, corrected code to leave all numbers after dot, please check attachment, press Run button
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    HI Allot of answered. Thanks allot to all of you. I have tested all of them.
    Patel45 your code is great works without any problems and also fast. Thanks
    Watersev. Your code works and its fast also. So great code also thanks
    Jindon just saw your code. I checked it it works like a charm. Thanks allot

    AB33 i changed your code a little. It remove the comma, but i need to run it double so it also remove the dot.
    It just have one bad thing.It remove dot and comma for all columns. I tried this to record my self and that was my problem.
    But if only one column it will work fine. Thanks allot

    xladept. Yes its the code you moderated today for me which is great. I am working on some i have to use on Monday. And i thought i could maybe moderate this one.
    The one you send is not working. It was taking long time and i have to stop it. But thanks allot for trying and also for earlier today. Really great help i got there.

    So a big thanksyou to all of you for you help

    I will mark this as solved.

    Have a nice evening to all of you

    Sincerely

    Abjac
    Last edited by abjac; 02-09-2013 at 04:56 PM.

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

    Re: Remove comma from column in working code.

    Why loop when it doesn't need to?

  16. #16
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Remove comma from column in working code.

    I wonder what happened - it ran on your sample in about 5 seconds???

    Can you send me a sample where it fails???
    Last edited by xladept; 02-09-2013 at 10:02 PM.

  17. #17
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    Hi xladept.
    It failed in this line
    Call TextToNo1
    I removed this line and its working in few seconds. But it has one error, and maybe i did not explain it good enough. It have to remove also the dots.
    The result after remove Call TextToNo1 is peerfect but it need to remove the dots also. With the same result after, with all the zeroes after the comma.
    You can have a check, i saw you loaded another code for the other thread, so i will check and test this one now also.

    Thanks allot for the answer. This forum is so great. many like to help and i have learned allot from you and other here.

    So thank you

    Sincerely

    Abjac

  18. #18
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Remove comma from column in working code.

    Hi Abjac,

    These should do the trick - but don't run more than once for each Range!

    Please Login or Register  to view this content.

  19. #19
    Forum Contributor
    Join Date
    07-28-2012
    Location
    madrid
    MS-Off Ver
    Excel 2010 at work excel 2016
    Posts
    1,102

    Re: Remove comma from column in working code.

    Hi And thanks I tried it but it come with a runtime error.
    this line

    For Each S In R: S = S * 100:

    But thanks alot for trying. Its solved and depend of your time, the other ís more important for me.

    Thanks allot

    SIncerely

    Abjac

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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