Thursday, 15 April 2010

excel - Unable to find small syntax error in VBA code -



excel - Unable to find small syntax error in VBA code -

i cannot find error(s) in code. trying insert formula in column s, when "cn equity" used in column a. want macro run row 6 69.

sub fx() dim x long x = 6 if instr(1, (range("a" & x).value), "cn equity") > 0 sheets("sheet1").range("s" & x).formula = "=bdp("cadusd bgn curncy","last_price")" & x end if x = x + 1 loop until x = 70 end sub

consider:

sub fx() dim x long x = 6 if instr(1, (range("a" & x).value), "cn equity") > 0 sheets("sheet1").range("s" & x).formula = "=bdp(""cadusd bgn curncy"",""last_price"")+" & x end if x = x + 1 loop until x = 70 end sub

note

replace + in formula * or & if necessary.

excel vba syntax-error

No comments:

Post a Comment