vba - Why Does This For Loop Not Execute? -


this non-looping code executes no problem:

if instr(1, sheets(1).range("a1"), "blah") > 0     sheets(2).range("a1") = sheets(1).range("b1") end if 

but need iterate through several rows; hence, loop:

dim integer = 1 10     if instr(1, sheets(1).cells(i, 1), "blah") > 0         sheets(2).cells(i, 1) = sheets(1).cells(i, 2)     else sheets(2).cells(i, 1) = ""     end if next 

the loop compiles , not crash, fails return output. why?

add 1 , 0 instr formula

instr(1, sheets(1).cells(i,1), "blah") > 0 

also, sure sheets(2)'s values ones changed?


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -