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