私はこれを徹底的にテストしていませんが、私のために働いています。基本的に、すべてのシートが自動調整され、自動調整によって拡張されない限り、元の幅に戻って列幅が設定されます。私は10列しかなく、1000行を超えることはなかったので、必要に応じてコードを調整します。
Sub ResizeCells()
Dim sheetCounter As Integer
Dim rowCounter As Integer
Dim colCounter As Integer
Dim totalWidth As Double
Dim oldColWidths(1 To 10) As Double
For sheetCounter = 1 To ThisWorkbook.Sheets.Count
ActiveWorkbook.Worksheets(sheetCounter).Select
totalWidth = 0
' Extend the columns out to 200
For colCounter = 1 To 10
oldColWidths(colCounter) = Cells(1, colCounter).ColumnWidth
totalWidth = totalWidth + oldColWidths(colCounter)
Cells(1, colCounter).ColumnWidth = 200
Next
For rowCounter = 4 To 1000
If Cells(rowCounter, 1).Value <> "" Or Cells(rowCounter, 2).Value <> "" Or Cells(rowCounter, 3).Value <> "" Then
Rows(rowCounter & ":" & rowCounter).EntireRow.AutoFit
End If
Next
' do autofit
For colCounter = 1 To 10
Cells(1, colCounter).EntireColumn.AutoFit
Next
' reset to original values if current width is less than the original width.
For colCounter = 1 To 10
If Cells(1, colCounter).ColumnWidth < oldColWidths(colCounter) + 0.25 Then
Cells(1, colCounter).ColumnWidth = oldColWidths(colCounter)
End If
Next
Next
End Sub