VBA 设置单元格格式

庆年工坊 
知道合伙人互联网行家 推荐于2017-10-02

1

2

3

4

5

6

7

8

Sub s()

    [a1].NumberFormatLocal = "@" '设置A1单元格为文本格式

    [b1].NumberFormatLocal = "yyyy/m/d" '设置B1单元格为日期格式

    [c1].NumberFormatLocal = "[$-F400]h:mm:ss AM/PM" '设置C1单元格为时间格式

    [d1].NumberFormatLocal = "0.00%" '设置D1单元格为百分比格式

    [e1].NumberFormatLocal = "0.00E+00" '设置E1单元格为科学记数法格式

    [f1].NumberFormatLocal = "G/通用格式" '设置F1单元格为常规格式

End Sub

原文地址:https://www.cnblogs.com/grj001/p/12225427.html