VBA实例03:批量修改Excel文件字体
'设置Excel工作簿字体为Times New Roman,大小为10
Sub opena()
Dim sht As Worksheet
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Workbooks.Open Filename:="C:\test.xlsx"
For Each sht In Sheets
sht.Activate
Cells.Select
With Selection.Font
.Name = "Times New Roman"
.Size = 10
End With
Range("a1").Select
Next
Sheets(1).Select
Range("a1").Select
ActiveWorkbook.Save
ActiveWorkbook.Close
Application.ScreenUpdating = True
Application.DisplayAlerts = True
MsgBox ("完成")
End Sub
本文标题:VBA实例03:批量修改Excel文件字体
本文链接:https://www.haomeiwen.com/subject/acxrnctx.html
网友评论