将十进制数填入Excel /逗号和小数点分隔符 [英] Pasting decimal numbers in excel / comma and point decimal separator

查看:159
本文介绍了将十进制数填入Excel /逗号和小数点分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用DDE获取数据到excel。我从DDE每秒获得一个新值,并使用一个宏来存储下一行的每个值。所以这么好。



问题是小数分隔符。



我从DDE获取一个值,如-5.18834
使用宏或将其粘贴到excel中,该值显示为-518.557,但实际值为-518557 。
小数点被excel错误地解释。当我在记事本中粘贴相同的值时,我得到正确的值,即-5.18557
我尝试在Excel中将值减去10000,但是一些值是5个数字而不是6,所以再次出错。



我尝试格式化单元格,更改excel选项中的小数分隔符,更改了我的电脑上的区域设置,但没有一个工作。
我也尝试添加TextFileDecimalSeparator =。在宏(在本网站上发现),但是也不行。
宏完成后处理数据不是一个选项。



感谢任何帮助。

解决方案

你的枚举,你已经尝试了,似乎可以排除这一点,但如果以下的方法不起作用,我会非常困惑:

  Application.DecimalSeparator =。 
Application.ThousandsSeparator =,
Application.UseSystemSeparators = False

'这里做你的粘贴

Application.UseSystemSeparators = True


I want to get data into excel using DDE. I get an new value every second from the DDE and use a macro to store every value in the next row. So for so good.

Problem is the decimal separator.

I get from the DDE a value like -5.18834 Using the macro or pasting it into excel, the value shows -518.557 but the actual value is -518557. The decimal point gets wrongly interpreted by excel. When I paste the same value in notepad I get correct value i.e. -5.18557 I tried deviding the value by 10000 in excel, but some values are 5 numbers instead of 6, so then it's wrong again.

I tried formatting cells, changing decimal separator in excel's options, changed regional setting on my pc but none of those work. I also tried adding TextFileDecimalSeparator = "." in the macro (found on this website) but that doesn't work either. Processing the data after the macro has finished is not an option.

Thanks for any help.

解决方案

Your enumeration, of what you have tried already, seems to rule this out, but i would be very bewildered if the following not would work:

Application.DecimalSeparator = "."
Application.ThousandsSeparator = ","
Application.UseSystemSeparators = False

' here do your paste

Application.UseSystemSeparators = True

这篇关于将十进制数填入Excel /逗号和小数点分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆