Excel Macro或VBA,用于使所选范围值成为绝对值 [英] Excel Macro or VBA for making selected range values absolute

查看:164
本文介绍了Excel Macro或VBA,用于使所选范围值成为绝对值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以使用Excel VBA通​​过单个按钮帮助我确定所选范围值的所有值是否都是绝对值(或对范围中的每个单元格应用绝对公式吗?)

Can anybody help me out in making all values of my selected range values Absolute (or applying absolute formula on each cell in a range) by single button using Excel VBA?

   A              B               C
5.119999886  -13.06999969   -13.14000034
-5.76999998  -12.52000046   -12.78999996
-5.88000011  -13.69999981   -14.13000011
5.46999979   -12.61999989   -12.48999977

推荐答案

不完全是VBA,但可以记录下来.

Not exactly VBA, but if required can be recorded.

选择您的数据范围,按Ctrl H(替换),在查找内容"中添加-"符号并替换所有内容.这将消除所有数字中的负号,并将其变为绝对.

Select your Data Range, press Ctrl H (Replace), in Find what add " - " sign and replace all. This will remove the negative sign from all numbers and it will become absolute.

注意:正如评论中提到的,OP同意这对他有效,因此将其发布为答案.

Note: As mentioned in comment that OP agrees that this works for him, hence posting as an answer.

这篇关于Excel Macro或VBA,用于使所选范围值成为绝对值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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