I am attempting to clear various cells within a workbook. However, writing a macro that clears each cell individually freezes my workbook. I've tried selecting all cells at once then clearing. This is causing a "union" and causing additional issues.
If anyone could help with this that would be great.... This is SUPER DIRTY!
****
If anyone could help with this that would be great.... This is SUPER DIRTY!
****
Code:
Sub clearall()
'
' clearall Macro
'
'
Application.ScreenUpdating = False
Range("B222").Activate
Selection.ClearContents
Range("B214:P214").Select
Range("N214").Activate
Selection.ClearContents
Range("B211:Q211").Select
Range("P211").Activate
Selection.ClearContents
Range("B208:O208").Select
Range("K208").Activate
Selection.ClearContents
Range("B196:R203").Select
Range("P203").Activate
Selection.ClearContents
Range("B193:L193").Select
Range("I193").Activate
Selection.ClearContents
Range("B190:Q190").Select
Range("O190").Activate
Selection.ClearContents
Range("J187").Select
Selection.ClearContents
Range("B179:Q182").Select
Range("L182").Activate
Selection.ClearContents
Range("B171:R173").Select
Range("B173").Activate
Selection.ClearContents
Range("B168:L168").Select
Range("J168").Activate
Selection.ClearContents
Range("B165:R165").Select
Range("P165").Activate
Selection.ClearContents
Range("B159:F159").Select
Selection.ClearContents
Range("B156:O156").Select
Range("M156").Activate
Selection.ClearContents
Range("B153:O153").Select
Range("N153").Activate
Selection.ClearContents
Range("B150:O150").Select
Range("J150").Activate
Selection.ClearContents
Range("E144:G144").Select
Selection.ClearContents
Range("B144:C144").Select
Selection.ClearContents
Range("E141:G141").Select
Selection.ClearContents
Range("B141:C141").Select
Selection.ClearContents
Range("B134:S136").Select
Range("B136").Activate
Selection.ClearContents
Range("B129:S131").Select
Range("B131").Activate
Selection.ClearContents
Range("B126:P126").Select
Range("N126").Activate
Selection.ClearContents
Range("B123:Q123").Select
Range("P123").Activate
Selection.ClearContents
Range("B120:O120").Select
Range("K120").Activate
Selection.ClearContents
Range("B99:E115").Select
Range("B115").Activate
Selection.ClearContents
Range("N96").Select
Selection.ClearContents
Range("K96:L96").Select
Selection.ClearContents
Range("H96:I96").Select
Selection.ClearContents
Range("E96:F96").Select
Selection.ClearContents
Range("B96:C96").Select
Selection.ClearContents
Range("W93:X93").Select
Selection.ClearContents
Range("T93:U93").Select
Selection.ClearContents
Range("P93:Q93").Select
Selection.ClearContents
Range("M93:N93").Select
Selection.ClearContents
Range("J93:K93").Select
Selection.ClearContents
Range("G93:H93").Select
Selection.ClearContents
Range("B93:E93").Select
Selection.ClearContents
Range("K90:M90").Select
Selection.ClearContents
Range("G90:I90").Select
Selection.ClearContents
Range("B90:E90").Select
Selection.ClearContents
Range("D74:J85").Select
Range("H85").Activate
Selection.ClearContents
Range("K71:L71").Select
Selection.ClearContents
Range("H71:I71").Select
Selection.ClearContents
Range("E71:F71").Select
Selection.ClearContents
Range("B71:C71").Select
Selection.ClearContents
Range("W68:X68").Select
Selection.ClearContents
Range("S68:U68").Select
Selection.ClearContents
Range("O68:Q68").Select
Selection.ClearContents
Range("K68:M68").Select
Selection.ClearContents
Range("G68:I68").Select
Selection.ClearContents
Range("B68:E68").Select
Selection.ClearContents
Range("W62:X62").Select
Selection.ClearContents
Range("S62:U62").Select
Selection.ClearContents
Range("O62:Q62").Select
Selection.ClearContents
Range("K62:M62").Select
Selection.ClearContents
Range("G62:I62").Select
Selection.ClearContents
Range("B62:E62").Select
Selection.ClearContents
Range("W59:Y59").Select
Selection.ClearContents
Range("S59:U59").Select
Selection.ClearContents
Range("O59:Q59").Select
Selection.ClearContents
Range("K59:M59").Select
Selection.ClearContents
Range("G59:I59").Select
Selection.ClearContents
Range("B59:E59").Select
Selection.ClearContents
Range("W54:X54").Select
Selection.ClearContents
Range("S54:U54").Select
Selection.ClearContents
Range("O54:Q54").Select
Selection.ClearContents
Range("K54:M54").Select
Selection.ClearContents
Range("G54:I54").Select
Selection.ClearContents
Range("B54:E54").Select
Selection.ClearContents
Range("V50:X51").Select
Selection.ClearContents
Range("R50:T50").Select
Selection.ClearContents
Range("O50:P50").Select
Selection.ClearContents
Range("K50:M50").Select
Selection.ClearContents
Range("G50:I50").Select
Selection.ClearContents
Range("B50:E50").Select
Selection.ClearContents
Range("C40:D40").Select
Selection.ClearContents
Range("S28:T28").Select
Selection.ClearContents
Range("O28:Q28").Select
Selection.ClearContents
Range("K28:M28").Select
Selection.ClearContents
Range("H28:I28").Select
Selection.ClearContents
Range("C28:F28").Select
Selection.ClearContents
Range("H25:M25").Select
Selection.ClearContents
Range("C25:F25").Select
Selection.ClearContents
Range("O22:T22").Select
Selection.ClearContents
Range("H22:M22").Select
Selection.ClearContents
Range("C22:F22").Select
Selection.ClearContents
Range("Q14:R14").Select
Selection.ClearContents
Range("K14").Select
Selection.ClearContents
Range("E14:G14").Select
Selection.ClearContents
Range("Q11:T11").Select
Selection.ClearContents
Range("J11:M11").Select
Selection.ClearContents
Range("D11:F11").Select
Selection.ClearContents
Range("Q7:T7").Select
Selection.ClearContents
Range("J7:M7").Select
Selection.ClearContents
Range("D7:F7").Select
Selection.ClearContents
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: