Clearly I need help with VBA. I recorded a macro to clear various cells. However this slows the entire sheet down.
is there a way to achieve the below an cleaner way that won't make my screen blink continually?
Application.ScreenUpdating = True
Range("B138:Q149").Select
Range("O149").Activate
Selection.ClearContents
Range("K133:Q135").Select
Selection.ClearContents
Range("F134:H134").Select
Selection.ClearContents
Range("B134:D134").Select
Selection.ClearContents
Range("K126:Q127").Select
Selection.ClearContents
Range("G127:H127").Select
Selection.ClearContents
Range("B127:E127").Select
Selection.ClearContents
Range("J124:M124").Select
Selection.ClearContents
Range("G124:H124").Select
Selection.ClearContents
Range("B124:E124").Select
Selection.ClearContents
Range("B108:T118").Select
Range("R118").Activate
Selection.ClearContents
Range("B97:S102").Select
Range("B102").Activate
Selection.ClearContents
Range("B94:P94").Select
Range("N94").Activate
Selection.ClearContents
Range("B91:Q91").Select
Range("P91").Activate
Selection.ClearContents
Range("B88:O88").Select
Range("K88").Activate
Selection.ClearContents
Range("B76:R83").Select
Range("P83").Activate
Selection.ClearContents
Range("B73:L73").Select
Range("I73").Activate
Selection.ClearContents
Range("B70:Q70").Select
Range("O70").Activate
Selection.ClearContents
Range("L62:R64").Select
Selection.ClearContents
Range("B63:I63").Select
Range("F63").Activate
Selection.ClearContents
Range("B59:O61").Select
Range("J61").Activate
Selection.ClearContents
Range("B51:R53").Select
Range("B53").Activate
Selection.ClearContents
Range("B48:L48").Select
Range("J48").Activate
Selection.ClearContents
Range("B45:R45").Select
Range("P45").Activate
Selection.ClearContents
Range("B39:F39").Select
Selection.ClearContents
Range("B36:O36").Select
Range("M36").Activate
Selection.ClearContents
Range("B33:O33").Select
Range("N33").Activate
Selection.ClearContents
Range("B30:O30").Select
Range("J30").Activate
Selection.ClearContents
Range("E24:G24").Select
Selection.ClearContents
Range("B24:C24").Select
Selection.ClearContents
Range("E21:G21").Select
Selection.ClearContents
Range("B21:C21").Select
Selection.ClearContents
Range("R15:U15").Select
Selection.ClearContents
Range("N15:P15").Select
Selection.ClearContents
Range("K15:L15").Select
Selection.ClearContents
Range("F15:I15").Select
Selection.ClearContents
Range("B15:D15").Select
Selection.ClearContents
Range("R12:U12").Select
Selection.ClearContents
Range("O12:P12").Select
Selection.ClearContents
Range("K12:M12").Select
Selection.ClearContents
Range("F12:I12").Select
Selection.ClearContents
Range("B12:D12").Select
Selection.ClearContents
Range("E6:G6").Select
Selection.ClearContents
Range("E4:G4").Select
Selection.ClearContents
Application.ScreenUpdating = False
End Sub
is there a way to achieve the below an cleaner way that won't make my screen blink continually?
Application.ScreenUpdating = True
Range("B138:Q149").Select
Range("O149").Activate
Selection.ClearContents
Range("K133:Q135").Select
Selection.ClearContents
Range("F134:H134").Select
Selection.ClearContents
Range("B134:D134").Select
Selection.ClearContents
Range("K126:Q127").Select
Selection.ClearContents
Range("G127:H127").Select
Selection.ClearContents
Range("B127:E127").Select
Selection.ClearContents
Range("J124:M124").Select
Selection.ClearContents
Range("G124:H124").Select
Selection.ClearContents
Range("B124:E124").Select
Selection.ClearContents
Range("B108:T118").Select
Range("R118").Activate
Selection.ClearContents
Range("B97:S102").Select
Range("B102").Activate
Selection.ClearContents
Range("B94:P94").Select
Range("N94").Activate
Selection.ClearContents
Range("B91:Q91").Select
Range("P91").Activate
Selection.ClearContents
Range("B88:O88").Select
Range("K88").Activate
Selection.ClearContents
Range("B76:R83").Select
Range("P83").Activate
Selection.ClearContents
Range("B73:L73").Select
Range("I73").Activate
Selection.ClearContents
Range("B70:Q70").Select
Range("O70").Activate
Selection.ClearContents
Range("L62:R64").Select
Selection.ClearContents
Range("B63:I63").Select
Range("F63").Activate
Selection.ClearContents
Range("B59:O61").Select
Range("J61").Activate
Selection.ClearContents
Range("B51:R53").Select
Range("B53").Activate
Selection.ClearContents
Range("B48:L48").Select
Range("J48").Activate
Selection.ClearContents
Range("B45:R45").Select
Range("P45").Activate
Selection.ClearContents
Range("B39:F39").Select
Selection.ClearContents
Range("B36:O36").Select
Range("M36").Activate
Selection.ClearContents
Range("B33:O33").Select
Range("N33").Activate
Selection.ClearContents
Range("B30:O30").Select
Range("J30").Activate
Selection.ClearContents
Range("E24:G24").Select
Selection.ClearContents
Range("B24:C24").Select
Selection.ClearContents
Range("E21:G21").Select
Selection.ClearContents
Range("B21:C21").Select
Selection.ClearContents
Range("R15:U15").Select
Selection.ClearContents
Range("N15:P15").Select
Selection.ClearContents
Range("K15:L15").Select
Selection.ClearContents
Range("F15:I15").Select
Selection.ClearContents
Range("B15:D15").Select
Selection.ClearContents
Range("R12:U12").Select
Selection.ClearContents
Range("O12:P12").Select
Selection.ClearContents
Range("K12:M12").Select
Selection.ClearContents
Range("F12:I12").Select
Selection.ClearContents
Range("B12:D12").Select
Selection.ClearContents
Range("E6:G6").Select
Selection.ClearContents
Range("E4:G4").Select
Selection.ClearContents
Application.ScreenUpdating = False
End Sub