人气 3699

VBA常见的单元格数据格式设置 [复制链接]

@Xizi_P8dStzbT 2017-2-24 16:44:56
摘自:追风者头条常见的单元格数据格式:Range("a1").NumberFormat = "0.00"  '将数字设置为两位小数;Range("a1").NumberFormat = "0.00%"  '将数字设置为两位小数的百分数;Range("a1").NumberFormat = "000000"  '将数字设置为6位整数(邮编);Range("a1").NumberFormat = "@"  '将数字设置为文本;RRange("a1").NumberFormat = "[DBNum2]"  '将数字设置为中文大写;RRange("a1").NumberFormatLocal = "(¥#,##0.00_); [红色] (¥#,##0.00)"  '将数字设置为人民币;Range("a1").NumberFormat = "yyyy年m月d日"  '设置为日期;Range("a1").NumberFormat = "yyyy年m月d日aaaa"  '设置为日期星期几;Range("a1").NumberFormat = "yyyy-m-d dddd"  '设置为日期星期几;Range("a1").NumberFormat = "mmmm"  ' 设置英文全称;Range("a1").NumberFormat = "mmm"  '设置英文简称;Range("a1").NumberFormat = "aaaa"  '设置汉语星期;Range("a1").NumberFormat = "dddd"  '设置英语星期;Range("a1").NumberFormat = ";;"  '隐藏单元格数字;Range("a1").NumberFormat = ";;;"  '将隐藏单元格数字和文本Range("a1").NumberFormat = "0;-0;;@"  '隐藏单元格零值
您需要登录后才可以回帖 登录 | 立即注册

QQ|手机版|精益人 ( 沪ICP备19004111号-1 )|网站地图

GMT+8, 2024-12-22 17:58 , Processed in 0.244329 second(s), 19 queries .

Powered by Lean.ren X3.5 Licensed  © 2001-2030 LEAN.REN