VBA error in for - next loop

VBA error in for - next loop

Hi there
A few weeks ago I finished adjusting a code I had created in Excel to work with my Zoho Sheets file.
I was very happy with the result, as far as I know you are the only online application that supports Excel VBA.
When I opened the file today, after several weeks of inactivity, it returned an error in one macro which had not posed any problems when I worked with the file the last time.

Anywho, here's the code that returns an error:
  1. Sub ClearEmpty()

  2.   For k = 1 to 15
  3.       Worksheets(k).UsedRange.Select
  4.           For i = Selection.Rows.Count To 1 Step -1
  5.               If WorksheetFunction.CountA(Selection.Rows(i)) = 0 Then
  6.                   Selection.Rows(i).EntireRow.Delete
  7.               End If
  8.           Next i
  9.   Next k
  10.   
  11. End Sub
And this is the error message I get: "Encountered error at line 11 :Application defined error"

Basically what this macro does is scroll through the first 15 sheets and deletes any empty rows.