I have the following code to clear data on selected sheets. I would like to streamline the code to make it neater
It would be appreciated if someone could assist me
It would be appreciated if someone could assist me
Code:
Sub Clear_Data()
Sheets("Sheet1").select
Dim Lr1 As Long
Lr1 = Cells(Rows.Count, "D").Rows.End(xlUp).Row
With Range("D1:E" & Lr1)
.ClearContents
End With
Sheets("Extracted Data").Select
Dim Lr As Long
Lr = Cells(Rows.Count, "A").Rows.End(xlUp).Row
With Range("A1:B" & Lr)
.ClearContents
End With
Sheets("Output Accounts").Select
With Range("A1:B" & Lr)
.ClearContents
End With
Sheets("Input Accounts").Select
With Range("A1:B" & Lr)
.ClearContents
End With
Sheets("Consignment Vat").Select
With Range("A1:B" & Lr)
.ClearContents
End With
End Sub