Excel VBA: inserting WHEN formula into specific range of cells with variable changing column -
hello dear stackoverflow users, my issue regarding inserting formular via macro specific range of cells. again, again , again. so basic function of formula should following: =when('zek '!f3="x";"6";when('zek '!g3="x";"8";"1")) in macro has change column next specific range. happening in loop i growing. meaning --> =when('zek '!$f$"& i+2 &"....... or in other syntax should work. try not, thats why need help. this initial try exchanged literally strings: sub 123() dim a,b,c string = 1 b = 6 c = 8 .... 'used , declared variables k, x, f, a, b, c range(cells(k + 2, 5), cells(k + 27, 5)).formular1c1 = _ "=when('zek'!$f$" & f & "=" & x & ";" & & ";when('zek'!$g$" & f & "=" & x & ";" & b & ";" & c & "))" end sub with run...