I have a workbook with different sheets, when i try to clear some ranges through vba code, it gives me error, please help me with this.
VBA Code:
Private Sub CommandButton5_Click()
Range("B13:F13").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("R13:S13").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("AG13:AH13").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("A2").Select
Sheets("RawDataBher").Select
Range("A2:E2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("H3:AA3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("AL3:AO3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Range("AR3:AS3").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.ClearContents
Sheets("Bherkund").Activate
Range("I7").Select
End Sub