excel - Functions of a class vba -
i building class has bunch of dictionaries store bunch of column data. depending on parameters, dictionaries printed little differently. created functions within class print data sheet. here class
sub export() 'finding next available cell activesheet lastrow = .cells(.rows.count, "a").end(xlup).row end nextrow = lastrow + 1 = 1 me.batchno.count if me.location(i) <> "a_ref " or me.location(i) <> "b_ref " me.notref(i,nextrow) 'syntax error here!!! else me.isref(i,nextrow) 'syntax error here!!! nextrow = nextrow + 1 next end sub
and here function calls
function notref(i integer, nextrow integer)
function isref(i integer, nextrow integer)
all functions print saved data "syntax error" when call them. calling them wrong? help.
i'm bit rusty on vba believe cannot call functions c/c++/c# style, allow ignore return value. vba function returns value , must therefore provide variable receive it. either or change functions subs, in case, if remember correctly, need remove parentheses.
correction can ignore return value in vba, treating function if sub, removing parentheses. (thanks @sam)
hth
Comments
Post a Comment