office交流網(wǎng)--QQ交流群號(hào)及微信交流群

Access培訓(xùn)群:792054000         Excel免費(fèi)交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

微信交流群(請(qǐng)用微信掃碼)

        

VBA代碼設(shè)置單元格或選擇區(qū)域的格式NumberFormatLocal

2020-05-22 08:00:00
zstmtony
原創(chuàng)
27646

VBA代碼設(shè)置單元格或選擇區(qū)域的格式
可以通過(guò) NumberFormatLocal 屬性來(lái)設(shè)置格式,以下是常用的格式代碼


   Selection.NumberFormatLocal ="G/通用格式"   '常規(guī)
   Selection.NumberFormatLocal = "0.00_ "  '數(shù)值
    Selection.NumberFormatLocal = "¥#,##0.00;¥-#,##0.00" '貨幣
    Selection.NumberFormatLocal = "_ ¥* #,##0.00_ ;_ ¥* -#,##0.00_ ;_ ¥* " & """" & "-" & """" & "??_ ;_ @_ "  '會(huì)計(jì)專用
    Selection.NumberFormatLocal = "yyyy/m/d;@" '日期
    Selection.NumberFormatLocal = "[$-409]h:mm:ss AM/PM;@" '時(shí)間
    Selection.NumberFormatLocal = "0.00%" '百分比
    Selection.NumberFormatLocal = "# ?/?" '分?jǐn)?shù)
    Selection.NumberFormatLocal = "0.00E+00" '科學(xué)記數(shù)
    Selection.NumberFormatLocal = "@" '文本
    Selection.NumberFormatLocal = "000000" '特殊
    Selection.NumberFormatLocal = "[DBNum2][$-804]G/通用格式" '中文大寫(xiě) '特殊
    Selection.NumberFormatLocal = "[DBNum2][$RMB]G/通用格式;[紅色][DBNum2][$RMB]G/通用格式" ''特殊人民幣大寫(xiě)
    Selection.NumberFormatLocal = "yyyy/mm/dd" '日期 '自定義

分享
文章分類
聯(lián)繫我們
聯(lián)繫人: 王先生
Email: 18449932@qq.com
QQ: 18449932
微博: officecn01
移動(dòng)訪問(wèn)