我有一列数字格式为常规
| 2.500,00 |
| 70,2 |
| ... |
我有一个宏尝试删除列中的点。
当我手动执行时,结果是
| 2500,00 |
| 70,2 |
| ... |
当我使用以下行执行此操作时:
Selection.Replace What:=".", Replacement:="", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
它删除了没有点的单元格中的逗号,结果如下所示:
| 2500,00 |
| 702 |
| ... |
最佳答案
您需要将 Excel 中使用的小数分隔符更改为逗号而不是点,以匹配您的数据。
从 Microsoft 复制:Change the character used to separate thousands or decimals
Click the Microsoft Office Button Office button image, and then click Excel Options.
On the Advanced tab, under Editing options, clear the Use system separators check box.
Type new separators in the Decimal separator and Thousands separator boxes.
TIP: When you want to use the system separators again, select the Use system separators check box.
NOTE: For a permanent solution, you must change the regional settings in Control Panel.
另一个解决方案:
其实我通常做的只是使用公式来删除点并将逗号转换为点。然后使用格式来显示您想要的数字。
=VALUE(SUBSTITUTE(SUBSTITUTE(A1,".",""),",","."))
关于excel - 从数字中删除点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36203249/