jebenexcel
Board Regular
- Joined
- Mar 16, 2018
- Messages
- 59
Hello guys,
I want to use VBA to assign the variable formula b into some cells inside a for loop. If I use .formula = "b" instead of .formula = b, i get the string "b" in the correct places. How do I get VBA to write b's value into those cells? What is the correct syntax? Should the &s be +s? Cause that didn't work either. There's probably a combination of wrong things in this code...
code:
I want to use VBA to assign the variable formula b into some cells inside a for loop. If I use .formula = "b" instead of .formula = b, i get the string "b" in the correct places. How do I get VBA to write b's value into those cells? What is the correct syntax? Should the &s be +s? Cause that didn't work either. There's probably a combination of wrong things in this code...
code:
Code:
b = "=IFERROR(IF('OBR1 (" & i & ")'!C13<>"";'OBR1 (" & i & ")'!C13;'OBR1 (" & i & ")'!C3);"")"
Sheets("a").Range("B" & j).Formula = b