+ Reply to Thread
Results 1 to 8 of 8

Macro deleting commas

  1. #1
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Macro deleting commas

    Hey,

    I have a workbook with a macro which grabs worksheets and saves them as there own individual workbooks on my desktop, as CSV files. is it possible to have a macro and go into each individual cell and delete all commas in the text before i run this macro? reason is i then import these CSV files into my access DB and the commas seperate the fields. so if the text has commas in it then it doesnt seperate the fiedls properly, thanks in advance!!!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Macro deleting commas

    Hi,

    Have you tried Find & Replace?
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro deleting commas

    Adding to Richard's suggestion perhaps a macro like this?

    Please Login or Register  to view this content.
    Alf

  4. #4
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Macro deleting commas

    Alf,

    how would i constrict this to just row 2? thanks,

  5. #5
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro deleting commas

    Perhaps like this?

    Please Login or Register  to view this content.



    Alf

  6. #6
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Macro deleting commas

    that didnt work either, i have been trying to play around with the too pieces here, this is what i have but when i run it, nothing actually happens.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Macro deleting commas

    Strange as it works ok for me.

    To test file run macro "rem_comm_row". This will remove all commas from row 2

    Macro "remove_comma" will remove all commas from Sheet1

    Alf
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-05-2012
    Location
    Ontario, Canade
    MS-Off Ver
    Excel 2010
    Posts
    88

    Re: Macro deleting commas

    i got it to work, i removed the dim cell as Range,
    Please Login or Register  to view this content.
    thanks alf!

+ 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