需求:如下图,需将F、G、H共3列转换为
数字
格式
,F列保留为整数,G、H列保留为2位小数的
数字
(且不带千分位)。对于个例的需求,一般用分列就好了,但是考虑到日报之类的频繁需求,还是用代码的好。
1 Sub test3()
3 Dim irow As Long
4 Dim arr()
6 irow = ActiveWorkbook.Sheets(...
sub test()with activesheet.usedrange.numberformatlocal="".usedrange=.usedrange.valueend withend sub一般运行一次就可以将全部
文本
型
数字
变成数值型了
1 Excel.Application excel = new Excel.Application();...