VBA唏嘘戏——简单单元格的设定(实例)
由于有很多个Word文件,所以应用宏会更加方便排版,而且版式较为统一。
Sub 设置列宽()
'
' 设置列宽宏
'
'
ActiveDocument.Tables().Cell(, ).Width = '将Word表格的第7行第2列(即B7单元格)的宽度设为45
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" '将Word的表格第7行第17列单元格(Q7单元格)的值设置为空 ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width =
ActiveDocument.Tables().Cell(, ).Width = 70.5
ActiveDocument.Tables().Cell(, ).Range.Text = "" ActiveDocument.Tables().AllowAutoFit = False End Sub

VBA唏嘘戏——简单单元格的设定(实例)的更多相关文章
- 在Excel里用vba给合并的单元格添加注释
Excel里使用VBA对已经合并的单元格添加注释,直接使用AddComment会报: 运行时错误 '1004':应用程序定义或者对象定义错误 找了很多文章都没找到怎么解决,最后发现在AddCommen ...
- 【VBA】快速填充单元格
在Excle中,需要填充单元格,直接下拉,然后即可填充,但是使用VBA代码又该如何实现这个呢? 代码区域 Public Sub 快速填充() Dim myRange As range Cells.Cl ...
- 使用VBA将Excel指定单元格数据、字符串或者图表对象插入到Word模板指定书签处
准备工作: 1.首先需要提供一个word模板,并且标记好您要插入书签的位置,定义书签的命名.如图 2.模拟您要插入的Excel原始数据和图表对象 插入代码如下: Private Sub Command ...
- VBA赋值给指定单元格
这是一个Range对象基本操作实例,对指定单元格赋值,然后使用弹窗获取值. 代码如下: Sub test1() Worksheets( MsgBox "工作表Sheet1内单元格A5中的值为 ...
- html表格合并单元格的运用实例
效果图: 实现代码: <!DOCTYPE html><html><head><meta charset="UTF-8"><ti ...
- VBA对指定单元格填充颜色并且赋值
使用VBA对指定的单元格赋值并填充颜色 ====================================================== 代码区域 ==================== ...
- c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
一.单元格内容的操作 *****// 取得当前单元格内容 Console.WriteLine(DataGridView1.CurrentCell.Value); // 取得当前单元格的列 Index ...
- 【表格设置】HTML中合并单元格,对列组合应用样式,适应各浏览器的内容换行
1.常用表格标签 普通 <table> | <tr> | | <th ...
- 转:c# WinForm开发 DataGridView控件的各种操作总结(单元格操作,属性设置)
一.单元格内容的操作 *****// 取得当前单元格内容 Console.WriteLine(DataGridView1.CurrentCell.Value); // 取得当前单元格的列 Index ...
随机推荐
- linux下关掉teamviewer服务
一.情景介绍 OS: ubuntu14.04 64bit teamviewer版本:10.0.36281 刚才看见已经关掉了teamviewer,但是通过ps看以下进程情况,却还存在该进程,于是: 二 ...
- s5pv210 cpu运行debian
1.环境准备 sudo apt-get install binfmt-support qemu qemu-user-static debootstrap 2.获取debian根文件系统 2.1.cd ...
- Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider停住了
2015.1.24进行了服务器的搬家,搬家后,更换了新的IP,导致新的IP访问以前IP的数据库服务无法成功Initializing connection provider: org.springfra ...
- 阿里云产品搭建web应用梳理
阿里云搭建web应用梳理 要搭建web应用,主要需要准备两部分内容,一部分是域名,另一部分就是服务器.下面分别对在阿里如何准备这两部分内容做一个简要说明. 一.域名 提供域 ...
- Linux提权基础
英文原文: Basic Linux Privilege Escalation 在开始之前,我想指出 - 我不是专家. 据我所知,在这个巨大的领域没有一个“魔法”的答案. 这只是我的发现,写出来,共享而 ...
- 在阿里云配置URL的REWRITE模式
今天买了阿里云的虚拟主机,然后把我的项目上传. 网站首页能够访问,但是点开任何页面,都是提示No input file specified,猜测应该是URL重写没有生效,我在浏览器地址把index.p ...
- 安卓自定义View(一)自定义控件属性
自定义View增加属性第一步:定义属性资源文件 在/res/values 文件夹下建立"Values XML layout",按照如下定义一个textview的属性 <?xm ...
- Ubuntu16.04安装Samba
在新装的ubuntu16.04下安装samba. 安装好samba后备份下配置文件: zhuben@zb:~$ sudo apt-get install samba zhuben@zb:~$ cd / ...
- css学习记录
1 !important 表示此属性需要优先考虑: <head> <title>Page Title</title> <style type=&q ...
- css样式之 direction
今天看到 direction:rtl.一时有点发傻. 其实就是文本读取顺序.默认是ltr从左向右读.rtl是从右向左读取.