paul_taylor
New Member
- Joined
- Feb 15, 2011
- Messages
- 33
I ran a macro to loop through all the sheets (about 10) in a workbook and clear out a certain range. The file grew from 200K to 5 MB. What's going on here? Can't figure it out.
Ho many rows of data were there previously in each tab?
Sub Macro3()
Dim sheetloop As Long
With Application
.ScreenUpdating = False
.Calculation = xlCalculationManual
End With
sheetloop = 4
For sheetloop = 4 To 14
Select Case sheetloop
Case 4, 5, 6, 8, 9, 10, 11, 13, 14
With Sheets(sheetloop)
.Range("A5:Z" & .Range("A" & Rows.Count).End(xlUp).Row).Clear
End With
Case 7
With Sheets(sheetloop)
.Range("A6:Z" & .Range("A" & Rows.Count).End(xlUp).Row).Clear
End With
Case 12
With Sheets(sheetloop)
.Range("A11:Z" & .Range("A" & Rows.Count).End(xlUp).Row).Clear
End With
End Select
Loop
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub