I assume you mean the cell is "" instead of " " as I would think a " " would work.

Change x=1 to:
if isempty(range("A1")) then x = range("A1").End(xlDown).Row else x=1