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 ...
随机推荐
- php 安装yar扩展
git:https://github.com/laruence/yar 先克隆 如果没有 git 需要先安装 yum install git 然后 克隆 git clone https://githu ...
- hrbust1841再就业(状态压缩dp)
本人刚学压缩dp,只能对这些水题写题解 一方面对自己的理解有加深作用 另一方面希望和各位大牛交流交流..... 如果有对状态dp不太了解的童鞋可以参考入门知识:http://wenku.baidu.c ...
- latex给表格添加注释
给表格加注释的确是很多TeX用户不好用的地方,这里提供一个样式和代码,或许对于你的学习使用有所帮助,样式如下: 代码如下: \documentclass[11pt,a4paper,english]{a ...
- iOS - AppStores App 上架
前言 1.准备 开发者账号 完工的项目 2.上架步骤 1) 创建 App ID 2) 创建证书请求文件(CSR文件) 3) 创建发布证书(CER) 4) 创建 Provisioning Profile ...
- [android]判断位置服务是否打开
public boolean isLocationEnabled() { int locationMode = 0; String locationProviders; if (Build.VERSI ...
- usb中的传输模式
别人总结的一个usb传输模式,保存一下 usb中的endpoint(端点)和传输模式 端点: 端点位于USB 外设内部,所有通信数据的来源或目的都基于这些端点,是一个可寻址的FIFO. 每个USB 外 ...
- [原创] Easy SysLite V1.2 (2016.5.29更新,新增加WIN10支持,一个程序适配所有系统减肥)
[原创] Easy SysLite V1.2 (2016.5.29更新,新增加WIN10支持,一个程序适配所有系统减肥) nohacks 发表于 2016-5-29 17:12:51 https:// ...
- SQL表关联赋值、系统表、表数据删除
1. 表与表的关联赋值(用于表与表之间有关联字段,数据互传) 双表关联赋值 UPDATE #B SET #B.D=#A.B from #B inner join #A on #B.C=#A.A 多表关 ...
- javascript实现登录验证码
1.js var code="" ; //在全局 定义验证码 function createCode(){ code = ""; ;//验证码的长度 var c ...
- javascript 字符串总结
match():查找字符串中特定的字符,如果找到这个字符,则返回这个字符: indexOf():定位这个字符串中某一个指定的字符首次出现的位置: sub():把字符串显示为下标: sup():把字符串 ...