Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8938973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:44:32+00:00 2026-06-15T10:44:32+00:00

Got a tiny problem, but I can’t get it right. Perhaps someone could help

  • 0

Got a tiny problem, but I can’t get it right. Perhaps someone could help me out. Much appriciated.
my Regional Settings for Decimal Separator is “.” (Dot).
i have an excel file, which contains decimals places in some columns. while updating the data in excel template i turned off the usersystem setting then applied DOT as the separator. While converting it to text file it is showing the comma “,” as the decimal separator.
I am turning of the the user settings by using below code

With Application
StrDecimal = .DecimalSeparator
StrThousand = .ThousandsSeparator

.DecimalSeparator = "."  
.ThousandsSeparator = "'" 
.UseSystemSeparators = False  
End With  

Need to check if the Decimal Separator is not eqaul to “.” then we need to force to use “.” aS Decimal separator.

Please help how to achieve this by using VBA or by using Datavalidation
Thank you very much in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:44:33+00:00Added an answer on June 15, 2026 at 10:44 am

    So you’ve got your data and are writing it to a textfile. Assuming your data is in an array, I’d loop through the array and convert the data after converting it to a string, like so.

    Sub ChangeDecimalSeperator()
        Dim vData As Variant, ii As Integer, jj As Integer
    
        vData = ActiveSheet.Range("A1:B2")
        For ii = LBound(vData, 1) To UBound(vData, 1)
            For jj = LBound(vData) To UBound(vData, 2)
                'Only convert if it's a number
                If VBA.IsNumeric(vData(ii, jj)) Then
                    'You can also specify the format using VBA.Format$() here, ie force the decimal places
                    vData(ii, jj) = ReplaceCharacter(VBA.CStr(vData(ii, jj)), ".", ",")
                End If
            Next jj
        Next ii
    
        'Now output vData to your textfile
    
    End Sub
    
    
    Function ReplaceCharacter(sForString As String, sReplacingCharacter As String, sWithCharacter As String) As String
        Dim sStringPrevious As String
    
        'While there is a character that we still need replacing left, keep going. If we can't find one, we're done
        Do
            sStringPrevious = sForString
            sForString = VBA.Replace(sForString, sReplacingCharacter, sWithCharacter)
        Loop Until sStringPrevious = sForString
    
        ReplaceCharacter = sForString
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have a tiny problem. I got help here a while ago about
I've got a tiny (I hope) problem again, and I don't know how to
This is a very tiny problem that I got. Following is my html select
Recently I was trying to solve a small AI problem but got stuck in
I got the twitter bootstrap dropdown buttons successfully working, but I have a tiny
I've got a simple (but not tiny) template for some HTML, complete with inline
..got a tiny little problem with mouse position after resizing browser window. I have
I got a tiny problem. First time I am doing a UL menu with
I've got a dataset with over 100k rows, so it's not tiny, but not
I got again tiny problem I would like to store strings in array I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.