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 ...
随机推荐
- 记SpannableString设多少span时注意事项
public void setSpan(Object what, int start, int end, int flags) { } 这个方法里的第一个参数,也就是一些span的对象,不能重复使用. ...
- TFS二次开发系列:六、TFS的版本控制
在TFS中对于版本控制是在WorkSpace工作区来控制的. 首先我们先整理WorkSpace的一些基本使用方法. CheckIn:迁入挂起的操作 CreateMapping:创建一个本地映射地址 D ...
- 浅谈一下关于使用css3来制作圆环进度条
最近PC端项目要做一个这样的页面出来,其他的都很简单,关键在于百分比的圆环效果.我最初打算是直接使用canvas来实现的,因为canvas实现一个圆是很简便的. 下面贴出canvas实现圆环的代码,有 ...
- Java输入输出流进阶
输入输出的内容是文本内容,考虑使用字符流. 输入输出的内容是二进制内容,考虑使用字节流. 凡是能用记事本打开并查看的内容称为文本文件,反之则为二进制文件. package ch15; import j ...
- python test
#!/usr/bin/env python #-*- encoding: utf- -*- ''' def foo(name): print name, '去砍柴' foo('yangshanlei: ...
- go并发
Go语言从语言层面上就支持了并发,这与其他语言大不一样,不像以前我们要用Thread库 来新建线程,还要用线程安全的队列库来共享数据. 以下是我入门的学习笔记. 首先,并行!=并发, 两者是不同的,可 ...
- [分享] 封装工具ES4配置文件解释
[分享] 封装工具ES4配置文件解释 LiQiang 发表于 2015-2-3 14:41:21 https://www.itsk.com/thread-346132-1-4.html [分享] 封装 ...
- 第二章 NIO入门
传统的同步阻塞式I/O编程 基于NIO的非阻塞编程 基于NIO2.0的异步非阻塞(AIO)编程 为什么要使用NIO编程 为什么选择Netty 第二章 NIO 入门 2.1 传统的BIO编程 2.1.1 ...
- 日常积累之JSON.stringify和JSON.parse substr
1.substr(start,len) 从字符串中读取内容,第一个参数是读取的首位置,如果为负数,则从末尾倒数计数. 第二个参数是要读取的长度. eg: var str = "silence ...
- 【JAVA】【leetcode】【使用堆栈实现后向计算】
题目:evaluate-reverse-polish-notation 要求: Evaluate the value of an arithmetic expression in Reverse Po ...