VBA設置單元格的格式


VBA設置單元格的格式

Sub 設置格式()

 

    [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單元格為常規格式

    [g1].NumberFormatLocal = "[DBNum2][$-804]G/通用格式元整" '人民幣大寫

 

End Sub


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM