I'm writing a "master" Excel document that creates new workbooks and saves them as ".csv" by using Visual Basic for Applications. The created workbooks contain measured data from two sources. One source already delivers the measure date in my regional settings (Holland, in which the comma ,
sign is commonly to used as decimal separator). The other source however delivers data with a dot .
as separator (American settings). I'd like to replace all dot signs for comma signs.
Is this possible with the Replace function?
(I guess this solution would only fail when applying it on values greater than 1.000,00 (or 1,000.00 for US settings). Which would be acceptable but far from perfect.
Attempts so far
Application.DecimalSeperator = ","
- Add,
local = true
after the line where the workbook is saved
In Addition
Excel thinks the values from the text document have 1000 separators 31.435. When i turn of the 1000-separator the value is 31435. I need it to be 31,435 (decimal Separated by comma , sign)
Do I need to adapt the cell format?
If so, then... How?
Any other options to solve this?
Anwser/Sollution(that works best for me)
Sheets(SheetNaamCNC).Range("B1").Select
Do While ActiveCell.Value <> ""
If InStr(ActiveCell.Value, "0,") = 0 Then
ActiveCell.Value = ActiveCell.Value / 1000
End If
ActiveCell.Offset(1, 0).Select
Loop