Error 1004 when clearing a row in excel using vba -
i'm building macro excel , when try , run it randomly breaks on lines when try clear column. throws error 1004 , don't know how fix since i'm quite new excel vba.
this code breaks on (with varying columns):
worksheets(sheet).range("a3", range("a3").end(xldown)).clear
is wrong way of doing it? should use function clear columns? in advance.
each time don't specify worksheet range refers to, refered active worksheet. try
worksheets(sheet).range("a3", worksheets(sheet).range("a3").end(xldown)).clear
Comments
Post a Comment