Hi everyone,
I have a sheet that is generated from data in another sheet with VBA.
In this VBA I fill formulas into this generated sheet automatically.
Now I need a new formula, and I have made one that works, but I struggle to fill it into the sheet with VBA.
The formula is as follows:
This is exactly as how I made it when putting the formula together in the worksheet, after it has been created.
Apologies for the norwegian function names. Here is a translation to English:
- HVIS = IF
- VENSTRE = LEFT
- HØYRE = RIGHT
- DELTEKST = MID
The VBA is based on english function names, so I translated it, to the following:
This gives an error, with a compile error: Expected: end of statement. Probably due to the fact that I use "" inside the formula. What's the best way to do this, anyway?
When changing this, so that I replace double with single quotes,
it throws a run-time error '1004': Application-defined or object-defined error.
Then, since I'm not completely sure about using [@Object] to point to the column, so I change to the relative reference:
This throws the same error: run-time error '1004': Application-defined or object-defined error.
For your reference - the source column is G and the destination column is I.
This is the context I want to use the formula in:
Can somebody explain what I'm doing wrong? My head is going sore of all this thinking.
Best regards,
Knut
Bookmarks