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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -