Dear Sir
Can you help to simplify below code since it is making excel sheet slow
Sub sbClearCellsOnly()
Range("B6:P6").ClearContents
Range("B10:P10").ClearContents
Range("B14:P14").ClearContents
Range("B18:P18").ClearContents
Range("B22:P22").ClearContents
Range("B26:P26").ClearContents
Range("B30:P30").ClearContents
Range("B34:P34").ClearContents
Range("B38:P38").ClearContents
Range("B42:P42").ClearContents
Range("B46:P46").ClearContents
Range("B50:P50").ClearContents
Range("B54:P54").ClearContents
Range("B58:P58").ClearContents
Range("B62:P62").ClearContents
Range("B66:P66").ClearContents
Range("B70:P70").ClearContents
Range("B74:P74").ClearContents
Range("B78:P78").ClearContents
Range("B82:P82").ClearContents
Range("B86:P86").ClearContents
Range("B90:P90").ClearContents
Range("B94:P94").ClearContents
Range("B98:P98").ClearContents
Range("B102:P102").ClearContents
Range("B106:P106").ClearContents
Range("B110:P110").ClearContents
Range("B114:P114").ClearContents
Range("B118:P118").ClearContents
Range("B122:P122").ClearContents
Range("B126:P126").ClearContents
Range("B130:P130").ClearContents
Range("B134:P134").ClearContents
Range("B138:P138").ClearContents
Range("B142:P142").ClearContents
Range("B146:P146").ClearContents
Range("B150:P150").ClearContents
Range("B154:P154").ClearContents
Range("B158:P158").ClearContents
Range("B162:P162").ClearContents
Range("B166:P166").ClearContents
Range("B170:P170").ClearContents
Range("B174:P174").ClearContents
Range("B178:P178").ClearContents
Range("B182:P182").ClearContents
Range("B186:P186").ClearContents
Range("B190:P190").ClearContents
Range("B194:P194").ClearContents
Range("B198:P198").ClearContents
Range("B202:P202").ClearContents
Range("B206:P206").ClearContents
Range("B210:P210").ClearContents
Range("B214:P214").ClearContents
Range("B218:P218").ClearContents
Range("B222:P222").ClearContents
Range("B226:P226").ClearContents
Range("B230:P230").ClearContents
Range("B234:P234").ClearContents
Range("B238:P238").ClearContents
Range("B242:P242").ClearContents
Range("B246:P246").ClearContents
Range("B250:P250").ClearContents
'
Range("B9:B250").Select
Range("B250").Activate
Selection.EntireRow.Hidden = True
Range("B6").Select
End Sub
Can you help to simplify below code since it is making excel sheet slow
Sub sbClearCellsOnly()
Range("B6:P6").ClearContents
Range("B10:P10").ClearContents
Range("B14:P14").ClearContents
Range("B18:P18").ClearContents
Range("B22:P22").ClearContents
Range("B26:P26").ClearContents
Range("B30:P30").ClearContents
Range("B34:P34").ClearContents
Range("B38:P38").ClearContents
Range("B42:P42").ClearContents
Range("B46:P46").ClearContents
Range("B50:P50").ClearContents
Range("B54:P54").ClearContents
Range("B58:P58").ClearContents
Range("B62:P62").ClearContents
Range("B66:P66").ClearContents
Range("B70:P70").ClearContents
Range("B74:P74").ClearContents
Range("B78:P78").ClearContents
Range("B82:P82").ClearContents
Range("B86:P86").ClearContents
Range("B90:P90").ClearContents
Range("B94:P94").ClearContents
Range("B98:P98").ClearContents
Range("B102:P102").ClearContents
Range("B106:P106").ClearContents
Range("B110:P110").ClearContents
Range("B114:P114").ClearContents
Range("B118:P118").ClearContents
Range("B122:P122").ClearContents
Range("B126:P126").ClearContents
Range("B130:P130").ClearContents
Range("B134:P134").ClearContents
Range("B138:P138").ClearContents
Range("B142:P142").ClearContents
Range("B146:P146").ClearContents
Range("B150:P150").ClearContents
Range("B154:P154").ClearContents
Range("B158:P158").ClearContents
Range("B162:P162").ClearContents
Range("B166:P166").ClearContents
Range("B170:P170").ClearContents
Range("B174:P174").ClearContents
Range("B178:P178").ClearContents
Range("B182:P182").ClearContents
Range("B186:P186").ClearContents
Range("B190:P190").ClearContents
Range("B194:P194").ClearContents
Range("B198:P198").ClearContents
Range("B202:P202").ClearContents
Range("B206:P206").ClearContents
Range("B210:P210").ClearContents
Range("B214:P214").ClearContents
Range("B218:P218").ClearContents
Range("B222:P222").ClearContents
Range("B226:P226").ClearContents
Range("B230:P230").ClearContents
Range("B234:P234").ClearContents
Range("B238:P238").ClearContents
Range("B242:P242").ClearContents
Range("B246:P246").ClearContents
Range("B250:P250").ClearContents
'
Range("B9:B250").Select
Range("B250").Activate
Selection.EntireRow.Hidden = True
Range("B6").Select
End Sub