You can easily do this with Power Query/Get and Transform. Load your file to PQ, filter out column C on null values. Then close and load back to Excel.
or you can change the line of code that is giving you issue to
Code:
ElseIf Iserror(Range("D" & i)) Then