VBA格式的单元格转换为常规 [英] VBA format cells to General

查看:531
本文介绍了VBA格式的单元格转换为常规的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将excel文件的格式设置为常规",但它不适用于所有单元格(某些单元格是自定义的,纯净的...).这是我的代码:

I would like to format a excel file to "General", but it's not working for all cells (some are custom, pourcentage...). here is my code :

With ActiveSheet.Range("A1").Resize(LineIndex, 1)
    .Value = WorksheetFunction.Transpose(strLine)
    .NumberFormat = "General"
    'DEFINE THE OPERATION FULLY!!!!
    .TextToColumns Destination:=.Cells(1), DataType:=xlDelimited, _
                   TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, _
                   Tab:=False, Semicolon:=False, Comma:=False, Space:=False, _
                   Other:=True, OtherChar:="|"

请帮助.

推荐答案

如果您想将所有单元格格式化为 General ,则可以使用类似的东西:

If you want to format all cells to General, then use something like:

Sub dural()
    ActiveSheet.Cells.NumberFormat = "General"
End Sub

这篇关于VBA格式的单元格转换为常规的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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