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 ...
随机推荐
- 用php导入10W条+ 级别的csv大文件数据到mysql。导出10W+级别数据到csv文件
转自:http://blog.csdn.net/think2me/article/details/12999907 1. 说说csv 和 Excel 这两者都是我们平时导出或者导入数据一般用到的载体. ...
- ettercap 命令
本地主机:192.168.0.149 目标主机:192.168.0.138 /etc/ettercap/etter.dns,将dns欺骗到本机 ettercap -T -q -i wlan0 -P d ...
- mybatis 简单实现 left join
sql -- 表a ta (id,aname,bid) -- 表b tb (id,bname) SELECT T1.*, T2.BNAME FROM TA T1 LEFT JOIN TB T2 ON ...
- 跟我学习css3之transition
HTML5和css3已经是将来的发展趋势,现在有很多移动端还有一些游戏公司已然使用它们开 发了比较成功的产品.我在2011年的时候也跟着技术潮流初浅的学习了html5+css3.毕竟那 时候我没有把学 ...
- 编写高质量代码改善C#程序的157个建议——建议91:可见字段应该重构为属性
建议91:可见字段应该重构为属性 字段和属性的本质区别就是属性是方法. 查看下面这个Person类型: class Person { public string Name { get; set; } ...
- Mysql的备份,权限与日志
1>Mysql的数据备份 mysqldump 工具 --single-transaction 该选项导出数据之前提交一个BEGIN SQL语句,不会阻塞任何应该程序而且能保证导出数据时的一 ...
- duilib入门简明教程 -- XML基础类(7)
现在大家应该对XML描述界面不那么陌生了,那么我们做进一步介绍. 前面的教程我们写了很多代码,为的是让大家了解下基本流程,其实duilib已经对常用的操作做了很好的包装,正式使用时无需像前面的教程那样 ...
- 腾讯云通信UserSig生成.Net实现
腾讯云通信后台生成usersig只有java实现代码.以下是根据java代码转换为net实现,java版GitHub地址:https://github.com/TencentVideoCloudMLV ...
- MVC下EF添加上下文
这里我们用Code First方法创建数据库表.这个方法简单点说就是先创建Model再根据Model生成数据库表. 为了方便起见,这里用的数据库是Visual Studio自带的LocalDb. 数据 ...
- .net core i上 K8S(五).netcore程序的hostip模式
上一章讲了pod的管理,今天再分享一个pod的访问方式 1.Pod的HostIP模式 Pod的HostIP模式,可以通过宿主机访问pod内的服务,创建yaml文件如下 apiVersion: v1 k ...