Excel如何批量调整多个工作簿的行高和列宽

例如一个文件夹里有500个Excel文件,统一调整第一列宽度为10,第二列宽度为15……如何操作。

Sub test()
Dim wb As Workbook, MyPath$, MyFile$
MyPath = ThisWorkbook.Path & "\"
MyFile = Dir(MyPath & "*.xls*")
Application.ScreenUpdating = False
Do While MyFile <> ""
If MyFile <> ThisWorkbook.Name Then
Set wb = Workbooks.Open(MyPath & MyFile)
wb.Sheets(1).Columns("A").ColumnWidth = 10
wb.Close True
End If
MyFile = Dir
Loop
Application.ScreenUpdating = True
MsgBox "OK"
End Sub
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-05-31
用宏可以做到
相似回答