スプレッドシートをクリーンアップしようとしています。カウントを外している多くの空白のセルがあります。このコードを使用してみましたが、実行時エラーが発生します。
Sub ClearAll()
Dim c As Range, MyRange As Range
Set MyRange = Range("A1:JS87")
For Each c In MyRange
If Len(c) = 0 Then c.ClearContents
Next c
End Sub