EXCEL 使用宏 打水印
2024-08-28 19:48:13
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
最新文章
- console使用方法
- PHP 获取图像信息 getimagesize 函数
- ios-model数据结构
- jquery 如何遍历json
- 堆的基础题目学习(EPI)
- Android 遍历界面控件
- 【翻译】Kinect v2程序设计(C++) BodyIndex篇
- Hadoop CLI MiniCluster
- 动态增加表单元素并获取元素的text和value提交
- css 相关算法
- My third homework
- QR二维码原理(一)
- AI人工智能顶级实战工程师 课程大纲
- 20155326刘美岑《网络对抗》Exp5 MSF基础应用
- laravel框架中报错 DataTables warning: table id=xxx-table - Cannot reinitialise DataTable.
- 利用windows的计划任务和eKing.CmdReadFileAndSendEmailOper(控制台小程序)实现远程登录服务器的邮件告警提醒
- Optimal Milking POJ - 2112 (多重最优匹配+最小费用最大流+最大值最小化 + Floyd)
- ECMAScript6新特性之Reflect
- 批量ping工具fping
- TCGA系列--TCGA长链非编码RNA的可视化工具TANRIC