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 ...
随机推荐
- 二项分布&超几何分布
伯努利分布 在一次试验中,事件A出现的概率为p,不出现的概率为q=1-p.若以β记事件A出现的次数,则β仅取0,1两值,相应的概率分布为: 二项分布是指在只有两个结果的n次独立的伯努利试验中,所期望 ...
- MySQL 存储过程 -光标的使用
#四.光标的使用 #声明光标 语法:DECLARE 光标名字 CURSOR FOR sql语句 #打开光标 OPEN 光标名称 #使用光标 FETCH 光标名称 into ... #关闭光标 CLOS ...
- UDP问题
这两天使用C#的UdpClient,本机的服务是采用MFC的socket发的,用C#做客户端,然后客户端启动时,出现该条错误信息 ==通常每个套接字地址(协议/网络地址/端口)只允许使用一次. 笔记的 ...
- JavaScript面向对象编程小游戏---贪吃蛇
1 面向对象编程思想在程序项目中有着非常明显的优势: 1- 1 代码可读性高.由于继承的存在,即使改变需求,那么维护也只是在局部模块 1- 2 维护非常方便并且成本较低. 2 这个demo是采用了 ...
- javascript总结39: 元素获取的常见问题
1 定义id属性的元素,不获取直接使用 由于id名具有唯一性,部分浏览器支持直接使用id名访问元素,但不是标准方式,生产环境下不推荐使用. 2 元素是对象 获取到的元素是DOM对象 ,DOM对象也有数 ...
- 关于Javascript 那些事
Javascript是一种由Netscape的LiveScript发展而来的原型化继承的面向对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为 ...
- java 访问HTTPS rest服务
import java.io.*;import java.net.*;import java.security.cert.CertificateException;import java.securi ...
- elasticsearch CriteriaQuery查询例子
elasticsearch CriteriaQuery java API实例应用 CriteriaQuery criteriaQuery = new CriteriaQuery(new Criteri ...
- shiro注解@RequiresPermissions多权限任选一参数用法
@RequiresPermissions(value={"xxx:xxx","xxx:xxx"},logical=Logical.OR)
- silverlight PopupWindow Resizeable兼容问题
下方第一段代码,在ie11中Resizeable无法生效,而在chrome中运行正常. HtmlPopupWindowOptions options = new HtmlPopupWindowOpti ...