I'm trying to use the following code to clear the contents of the two worksheets named Unpaid and Payments and then locate the cell pointer for that worksheet in cell A1 -
Worksheets("Unp aid").Cells.Cle arContents
Worksheets("Unp aid").Select
Range("A1").Sel ect
Worksheets("Pay ments").Cells.C learContents
Worksheets("Pay ments").Select
Range("A1").Sel ect
However when I try and run the code I get the following error -
Runtime error '1004'
Select method of range or class failed
Where am I going wrong?
Worksheets("Unp aid").Cells.Cle arContents
Worksheets("Unp aid").Select
Range("A1").Sel ect
Worksheets("Pay ments").Cells.C learContents
Worksheets("Pay ments").Select
Range("A1").Sel ect
However when I try and run the code I get the following error -
Runtime error '1004'
Select method of range or class failed
Where am I going wrong?
Comment