Phosphonothioic
Board Regular
- Joined
- Sep 27, 2009
- Messages
- 194
Trying to set up a basic snipet of code to cycle through an array of sheets and delete the used range if the sheet is not empty.
I'm getting an Overflow error. Where am I going wrong?
I'm getting an Overflow error. Where am I going wrong?
HTML:
Sub logicaltest()
Dim LastRow As Long
Dim rememberCalcMode As Long
Dim ShtArr
Dim ShtArrCounter As Long
Dim HeadArr
ShtArr = Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
For ShtArrCounter = LBound(ShtArr) To UBound(ShtArr)
With Sheets(ShtArr(SheetArrCounter))
If Application.WorksheetFunction.CountBlank(.Cells) = _
Rows.Count * Columns.Count Then
'Do Nothing
Else
.UsedRange.Delete
End If
End With
Next ShtArrCounter
...code