EXCEL宏问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 05:08:23
去除全部零值→设置为文本格式→字号为10号字→单元格居中→调整最合适列宽,页边距设置:靠上为0.8CM,左右为0.6CM,在A18输入“现金: ”(单元格文字靠右),A19输入“元(存入中行)”,M18输入“制表:”多谢晒,重酬!!!!
基于情况特别,请单Q909071919解决问题

Sub Macro1()
'

For Each c In Range("a1:H28") '此处的范围按你自己的需要定义
If c.Value = "0" Then
c.Value = ""
End If
Next

Cells.Select
Selection.NumberFormatLocal = "@"
With Selection.Font
.Name = "宋体"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Cells.EntireColumn.AutoFit
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End Wi