yuanlideyu的个人博客分享 http://blog.sciencenet.cn/u/yuanlideyu

博文

VBA 单元格设置

已有 1329 次阅读 2020-12-30 15:39 |个人分类:VBA|系统分类:科研笔记

#时隔两年,我又来学VBA了:)


字体字号

.Name  字体

.Size  大小

Strikethrough  删除线

Superscript  上标 

Subscript  下表

OutlineFont  字符边框??? 

Shadow 阴影

Underline 强调线

ColorIndex 颜色,

Bold  加粗 

Italic  斜体

专题: 颜色

法1 

    Selection.Interior.ColorIndex = 5

index 清单见 https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/cc296089(v=office.12)?redirectedfrom=MSDN#colorindex-property


法2

    Selection.Interior.Color = 16711680

    Selection.Interior.Color = &HFF0000

    Selection.Interior.Color = &O77600000

    Selection.Interior.Color = RGB(0, 0, 255)



对齐方式

HorizontalAlignment = excel.xlRight  水平右对齐

另,excel.xlLeft  左对齐

      excel.xlCenter  中心对齐

      excel.xlJustify  两端对齐

      excel.xlDistributed  分布对齐

VertivalAlignment = excel.xlTop  垂直上对齐

另,excel.xlBottom 下对齐

       excel.xlCenter  中心对齐

       excel.xlJustify  两端对齐

       excel.xlDistributed  分布对齐



https://blog.sciencenet.cn/blog-3388383-1264912.html

上一篇:专利类型&德温特数据库
收藏 IP: 117.172.29.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-5-21 16:30

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部