EXCEL 使用宏 打水印
Sub 宏1()
'
' 宏1 宏 //用于调整列宽 加边框
'
' 快捷键: Ctrl+w
'
ActiveCell.Cells.Select
ActiveCell.Cells.EntireColumn.AutoFit
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.ColumnWidth = 3.4
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
Selection.ColumnWidth =
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
Selection.ColumnWidth =
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
Selection.ColumnWidth = 6.78
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
Selection.ColumnWidth =
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
Selection.ColumnWidth =
ActiveCell.Offset(, -).Columns("A:A").EntireColumn.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation =
.AddIndent = False
.IndentLevel =
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.Offset(, ).Columns("A:A").EntireColumn.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.WrapText = True
.Orientation =
.AddIndent = False
.IndentLevel =
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
ActiveCell.Offset(, -).Range("A1:F75").Select
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
Selection.Borders(xlInsideVertical).LineStyle = xlNone
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
With Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.ColorIndex =
.TintAndShade =
.Weight = xlThin
End With
End Sub Sub 宏2()
'
' 宏2 宏
'
' 快捷键: Ctrl+Shift+O
'
ActiveSheet.Shapes.AddTextbox(msoTextOrientationHorizontal, 67.8, 73.2, , _
106.8).Select
Selection.ShapeRange.IncrementRotation -28.98145
Selection.ShapeRange.IncrementLeft -26.4
Selection.ShapeRange.IncrementTop -2.1204724409
Selection.ShapeRange().TextFrame2.TextRange.Characters.Text = ""
Selection.ShapeRange().TextFrame2.TextRange.Characters(, ).ParagraphFormat. _
FirstLineIndent =
With Selection.ShapeRange().TextFrame2.TextRange.Characters(, ).Font
.Bold = msoTrue
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.ObjectThemeColor = msoThemeColorDark1
.Fill.ForeColor.TintAndShade =
.Fill.ForeColor.Brightness =
.Fill.Transparency =
.Fill.Solid
.Size =
.Name = "+mn-lt"
End With
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Line.Visible = msoFalse
Application.CommandBars("Format Object").Visible = False
With Selection.ShapeRange.TextFrame2.TextRange.Font.Fill
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorDark1
.ForeColor.TintAndShade =
.ForeColor.Brightness =
.Transparency = 0.8299999833
.Solid
End With
End Sub Sub 宏3()
'
' 宏3 宏
'
' 快捷键: Ctrl+Shift+i
'
Application.CutCopyMode = False
Selection.Copy
ActiveSheet.Paste
Selection.ShapeRange.IncrementTop
Selection.ShapeRange.IncrementLeft -
ActiveSheet.Paste
Selection.ShapeRange.IncrementTop
Selection.ShapeRange.IncrementLeft -
ActiveSheet.Paste
Selection.ShapeRange.IncrementTop
Selection.ShapeRange.IncrementLeft -
End Sub
EXCEL 使用宏 打水印的更多相关文章
- C#调用Excel VBA宏
近日的一系列工作是做网站的营运维护,因此做了大量的支持工具.有Excel中写VBA的,也有直接C#做的工具.有时需要在C#中执行Excel VBA宏,甚至有时还需要在执行了VBA宏之后,获取返回值再进 ...
- [转]C#调用Excel VBA宏
[转载自]http://www.shangxueba.com/jingyan/95031.html 附上一段原创常用代码 计算列标题字符串 Function CalcColumn(ByVal c As ...
- C#调用Excel VBA宏[转载]
原文地址:https://www.cnblogs.com/heekui/archive/2008/03/30/1129355.html 近日的一系列工作是做网站的营运维护,因此做了大量的支持工具.有E ...
- 用2003版的Excel使用“宏”打开NMON软件生产的.nmon文件
用2003版的Excel使用“宏”打开NMON软件生产的.nmon文件 nmon analyser——生成 AIX 性能报告的免费工具,可从 NMON 的输出中生成大量的报告图形.nmon_analy ...
- 【Excel】宏之初认识
出于提高效率的原因,希望excel能够不需要人为干预的完成一些操作,学习excel宏的编写与调试: 第一列输入公式,第二类输出计算结果:(如果自动获取文件的行数,待补充) Sub Calc() a = ...
- 使用Sharepoint定时运行Excel中宏程序
需求:因为Excel中数据量很大,其中包含了几个宏程序从其他数据源读取数据,运行一次宏需要比较长的时间,为了不影响使用,要求每天半夜运行一次Excel中的宏(无参数),Excel存放在共盘上. 解决方 ...
- Excel通过宏创建百万数据
打开视图->宏->编辑,代码如下,cells(n,m)表示当前Excel表格第n行第m列</span> Sub newdata() Dim i As Long Cells(i, ...
- excel的宏与VBA入门(一)——基础概念
一.概述 "记录宏"其实就是将工作的一系列操作结果录制下来,并命名存储(相当于VB中一个子程序). 宏其实就是VBA写的,但是可以通过录制的方法制作宏,做好的宏你可以查看相应的VB ...
- 操作Excel的宏
有时候在Excel中,需要循环的算每一列的值,而这一列的值是某几列的求和或者某种运算后的结果,比如如下的C4=C3+B4 可以用一个宏来实现,宏代码如下: Dim i As In ...
随机推荐
- [GO]使用map生成 json
package main import ( "encoding/json" "fmt" ) func main() { m := make(map[) //因为 ...
- Yii2.0 多语言设置(高级版配置方法) - 新的方法
1.设置默认语言:在mail.php配置文件加上:'language'=>'zh_CN'; 2.多语言切换 (我这边是在site控制器里面操作的所以用的'/site/language') htm ...
- Python基于VS2013 开发环境搭建 Hello World 10分钟搞定
1.先下载Python 安装 Next ->安装完成 2.以前安装过VS2013 打开VS2013 文件->新建项目 (此时如果没有Python Application,请点击里面的安装插 ...
- java IO通过字节流,字符流 读出写入
一:通过字节流操作数据的写入,读出 /** * 通过字节流写入和读出 * @param args */ public static String filePath = "G:" + ...
- SQL的Join语法
对于SQL的Join,在学习起来可能是比较乱的.我们知道,SQL的Join语法有很多inner的,有outer的,有left的,有时候,对于Select出来的结果集是什么样子有点不是很清楚.Codin ...
- 10、Semantic-UI之图片的使用
10.1 图片的使用 定义有边框的图片样式 <img class="ui medium bordered image" src="../images/pic.png ...
- MyBatis 一级缓存避坑
MyBatis 一级缓存(MyBaits 称其为 Local Cache)无法关闭,但是有两种级别可选: package org.apache.ibatis.session; /** * @autho ...
- Linux Guard Service - 守护进程分裂
分裂守护进程 由于fork()后第一行仍然在循环中,使用fork()返回值鉴别当前进程的性质 int i = 0; for (i = 0; i < 10; i++) { // sleep(1); ...
- django+echarts
思路: 统一返回数据类型为json,然后前端发起Ajax请求后台数据接口 views.py def count_blog(request): # 下面等价于:select distinct auth, ...
- ArrayList用法详解与源码分析
说明 此文章分两部分,1.ArrayList用法.2.源码分析.先用法后分析是为了以后忘了查阅起来方便-- ArrayList 基本用法 1.创建ArrayList对象 //创建默认容量的数组列表(默 ...