I have a macro that clears a number of cells through out a workbook. Here's the slight dilemma. If I fire the macro, and I have an outline collapsed on another worksheet, it will give me an error message. For that reason, I need for the macro that clears the cells to "expand the outline" before it clears the results and thus works and won't give me the error on this line: .Range("E:E") = "". If I expand the OUTLINE to level 3, it will clear the Worksheet without a problem. How do I add a line or two of code to auto expand the outline to level 3 before it tries to clear the cells?
Here is what the code looks like.
Dim I As Integer
Application.EnableEvents = False
Application.ScreenUpdating = False
.Range("E:E") = ""
.Range("G800:G812") = ""
.Range("H7:H800") = ""
'.Range("r2") = 0
Application.ScreenUpdating = True
Application.EnableEvents = True