Excel如何批量调整多个工作簿的行高和列宽
发布网友
发布时间:2022-03-06 16:16
我来回答
共2个回答
热心网友
时间:2022-03-06 17:45
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
热心网友
时间:2022-03-06 19:03
用宏可以做到