Execute Macro can‘t work as expected

Can you check the properties of Excel Application Scope.
Make sure that read-only option is not checked. Copy option is not checked.

And also update the code to delete the cells for a particular sheet as below -

Dim a As Long
a = Sheet1.SpecialCells(xlLastCell).Row
Sheet1.Rows(10 & ":" & a).Delete shift:=xlUp

Regards,
Karthik Byggari

3 Likes