+ Reply to Thread
Results 1 to 8 of 8

Macro to replace symbol

  1. #1
    Registered User
    Join Date
    08-13-2013
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Macro to replace symbol

    I’m using a large database – excel based, with lots of VBA and macros inside – where the default decimal format is “.” (period). When I copy and paste into a normal excel workbook format I want to replace the periods with comas. The paste function I’m using is “Match Destination Formatting (M)”.

    I’ve recorded a macro to replace all of the periods with comas – still some of the values come up as a whole number, the period not being replaced with the coma.
    I’ve tried almost all of the formats – text, general, number… Still does not work.

    Would someone tell me what am I doing wrong and how can I fix?

    Thanks,
    Ilko

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro to replace symbol

    try this
    Please Login or Register  to view this content.
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  3. #3
    Registered User
    Join Date
    08-13-2013
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro to replace symbol

    John - thanks.

    The problem is that I do not know VBA. When you say cells.replace ".","," I dont know what to do.
    I'm only working with the existing within excel functions and formulas...

    Would you simplify your example, please?

    Thanks again

  4. #4
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro to replace symbol

    k, make a copy of yr file, a test file, then hit Alt+F11, insert module, copy-paste this piece of code
    Please Login or Register  to view this content.
    then hit Alt+F8 and run "replace".
    hope it helps you

  5. #5
    Registered User
    Join Date
    08-13-2013
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro to replace symbol

    After opening the module there is some script - do I paste it at the very beginning, at the end, somewhere in the middle of the module?

    After hitting Alt+F8 there is no "replace" to run...

    Apologies again, but I dont know VBA...

  6. #6
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro to replace symbol

    yeap, copy-paste the whole code posted, from "Sub...to end sub"

  7. #7
    Registered User
    Join Date
    08-13-2013
    Location
    Cologne, Germany
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Macro to replace symbol

    Unbelievable - it works... Thanks a lot, John!!!

  8. #8
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Macro to replace symbol

    glad to help you!
    if you are happy with the solution provided, please mark the thread as Solved.
    thx!

+ 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. Find/replace using symbol for end of cell?
    By greek in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-08-2009, 10:07 AM
  2. Find & Replace (*) Symbol
    By dvent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2008, 11:41 AM
  3. CAN I REPLACE NON-PRINTING CHAR(127) WITH A SYMBOL?
    By QDZF in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-18-2006, 08:15 PM
  4. Replace -1 with a tick symbol
    By Tom in forum Excel General
    Replies: 7
    Last Post: 02-05-2006, 11:45 AM
  5. Replies: 3
    Last Post: 05-03-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