+ Reply to Thread
Results 1 to 3 of 3

Replacing dot by a comma

Hybrid View

mqdias Replacing dot by a comma 09-19-2007, 12:52 PM
royUK Is the TextBox on a UserForm?... 09-19-2007, 01:06 PM
mqdias Yes it's in a userform. ... 09-19-2007, 01:20 PM
  1. #1
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189

    Replacing dot by a comma

    Hi.

    I would like to create a macro witch can detect dots in a textbox value and replace them by commas. I intend this because this is an issue that can only be overcomed by changing the Regional and Language Properties in the Control Panel, by definig the dot as the decimal mark,but i don't want to do this, because i would have to do that in every computer that this file is runed...

    So, does anyone know how to do this?

    Thank you!

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Is the TextBox on a UserForm? This works if it is

     Dim sText  As String
        sText = Me.TextBox1.Text
        sText = Replace(sText, ".", ",")
        Me.TextBox1.Text = sText
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-26-2006
    Posts
    189
    Yes it's in a userform.

    The textbox value is assumed as a "Double" variable, because it's suposed to be a number...

    I don't know if this changes your answer...

    thanks

+ 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