VBA格式的单元格为General

BKC*_*lia 7 excel vba excel-vba number-formatting

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

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:="|"
Run Code Online (Sandbox Code Playgroud)

请帮忙.

Gar*_*ent 14

如果要将所有单元格格式化为常规,请使用以下内容:

Sub dural()
    ActiveSheet.Cells.NumberFormat = "General"
End Sub
Run Code Online (Sandbox Code Playgroud)